New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@injectivelabs/chain-consumer

Package Overview
Dependencies
Maintainers
8
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injectivelabs/chain-consumer - npm Package Compare versions

Comparing version 0.0.68 to 0.0.69

dist/consumers/MintConsumer.d.ts

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.0.69](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/chain-consumer@0.0.68...@injectivelabs/chain-consumer@0.0.69) (2021-08-09)
### Features
* fetching params ([89b457a](https://github.com/InjectiveLabs/injective-ts/commit/89b457af18681c09035281b24161a190e00af402))
## [0.0.68](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/chain-consumer@0.0.67...@injectivelabs/chain-consumer@0.0.68) (2021-08-05)

@@ -8,0 +19,0 @@

2

dist/consumers/BankConsumer.d.ts
import { AccountAddress } from '@injectivelabs/ts-types';
import BaseConsumer from '../BaseConsumer';
import { GrpcBankParams } from '../types';
export declare class BankConsumer extends BaseConsumer {
fetchParams(): Promise<GrpcBankParams>;
fetchBalance({ accountAddress, denom, }: {

@@ -5,0 +7,0 @@ accountAddress: AccountAddress;

@@ -21,2 +21,14 @@ "use strict";

class BankConsumer extends BaseConsumer_1.default {
fetchParams() {
return __awaiter(this, void 0, void 0, function* () {
const request = new query_pb_1.QueryParamsRequest();
try {
const response = yield this.request(request, query_pb_service_1.Query.Params);
return response.getParams();
}
catch (e) {
throw new exceptions_1.GrpcException(e.message);
}
});
}
fetchBalance({ accountAddress, denom, }) {

@@ -23,0 +35,0 @@ return __awaiter(this, void 0, void 0, function* () {

import { AccountAddress } from '@injectivelabs/ts-types';
import BaseConsumer from '../BaseConsumer';
import { GrpcDistributionParams } from '../types';
export declare class DistributionConsumer extends BaseConsumer {
fetchParams(): Promise<GrpcDistributionParams>;
fetchDelegatorRewardsForValidator({ delegatorAddress, validatorAddress, }: {

@@ -5,0 +7,0 @@ delegatorAddress: AccountAddress;

@@ -21,2 +21,14 @@ "use strict";

class DistributionConsumer extends BaseConsumer_1.default {
fetchParams() {
return __awaiter(this, void 0, void 0, function* () {
const request = new query_pb_1.QueryParamsRequest();
try {
const response = yield this.request(request, query_pb_service_1.Query.Params);
return response.getParams();
}
catch (e) {
throw new exceptions_1.GrpcException(e.message);
}
});
}
fetchDelegatorRewardsForValidator({ delegatorAddress, validatorAddress, }) {

@@ -23,0 +35,0 @@ return __awaiter(this, void 0, void 0, function* () {

9

dist/consumers/GovernanceConsumer.d.ts
import { ProposalStatusMap } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/gov_pb';
import { QueryParamsResponse } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/query_pb';
import BaseConsumer from '../BaseConsumer';
import { PaginationOption } from '../types';
import { GrpcGovernanceDepositParams, GrpcGovernanceTallyParams, GrpcGovernanceVotingParams, PaginationOption } from '../types';
export declare class GovernanceConsumer extends BaseConsumer {
fetchParams(type: string): Promise<QueryParamsResponse>;
fetchParams(): Promise<{
depositParams: GrpcGovernanceDepositParams;
tallyParams: GrpcGovernanceTallyParams;
votingParams: GrpcGovernanceVotingParams;
}>;
fetchParamsByType(type: string): Promise<QueryParamsResponse>;
fetchProposals({ status, pagination, }: {

@@ -8,0 +13,0 @@ status: ProposalStatusMap[keyof ProposalStatusMap];

@@ -22,4 +22,28 @@ "use strict";

class GovernanceConsumer extends BaseConsumer_1.default {
fetchParams(type) {
fetchParams() {
return __awaiter(this, void 0, void 0, function* () {
const paramTypes = ['voting', 'deposit', 'tallying'];
const requests = paramTypes.map((type) => {
const request = new query_pb_1.QueryParamsRequest();
request.setParamsType(type);
return request;
});
try {
const responses = yield Promise.all(requests.map((request) => this.request(request, query_pb_service_1.Query.Params)));
const votingParams = responses.find((response) => response.hasVotingParams());
const tallyParams = responses.find((response) => response.hasTallyParams());
const depositParams = responses.find((response) => response.hasDepositParams());
return {
votingParams: votingParams.getVotingParams(),
tallyParams: tallyParams.getTallyParams(),
depositParams: depositParams.getDepositParams(),
};
}
catch (e) {
throw new exceptions_1.GrpcException(e.message);
}
});
}
fetchParamsByType(type) {
return __awaiter(this, void 0, void 0, function* () {
const request = new query_pb_1.QueryParamsRequest();

@@ -26,0 +50,0 @@ request.setParamsType(type);

@@ -5,5 +5,8 @@ export * from './BankConsumer';

export * from './DistributionConsumer';
export * from './MintConsumer';
export * from './GovernanceConsumer';
export * from './ExchangeConsumer';
export * from './InsuranceConsumer';
export * from './OracleConsumer';
export * from './PeggyConsumer';
//# sourceMappingURL=index.d.ts.map

@@ -17,5 +17,8 @@ "use strict";

__exportStar(require("./DistributionConsumer"), exports);
__exportStar(require("./MintConsumer"), exports);
__exportStar(require("./GovernanceConsumer"), exports);
__exportStar(require("./ExchangeConsumer"), exports);
__exportStar(require("./InsuranceConsumer"), exports);
__exportStar(require("./OracleConsumer"), exports);
__exportStar(require("./PeggyConsumer"), exports);
//# sourceMappingURL=index.js.map
import { AccountAddress } from '@injectivelabs/ts-types';
import BaseConsumer from '../BaseConsumer';
import { GrpcInsuranceParams } from '../types';
export declare class InsuranceConsumer extends BaseConsumer {
fetchParams(): Promise<import("@injectivelabs/chain-api/injective/insurance/v1beta1/insurance_pb").Params | undefined>;
fetchParams(): Promise<GrpcInsuranceParams>;
fetchInsuranceFunds(): Promise<import("@injectivelabs/chain-api/injective/insurance/v1beta1/insurance_pb").InsuranceFund[]>;

@@ -6,0 +7,0 @@ fetchInsuranceFund(marketId: string): Promise<import("@injectivelabs/chain-api/injective/insurance/v1beta1/insurance_pb").InsuranceFund | undefined>;

import BaseConsumer from '../BaseConsumer';
import { PaginationOption } from '../types';
import { PaginationOption, GrpcStakingParams } from '../types';
export declare class StakingConsumer extends BaseConsumer {
fetchParams(): Promise<GrpcStakingParams>;
fetchValidators(): Promise<{

@@ -5,0 +6,0 @@ validators: import("@injectivelabs/chain-api/cosmos/staking/v1beta1/staking_pb").Validator[];

@@ -22,2 +22,14 @@ "use strict";

class StakingConsumer extends BaseConsumer_1.default {
fetchParams() {
return __awaiter(this, void 0, void 0, function* () {
const request = new query_pb_1.QueryParamsRequest();
try {
const response = yield this.request(request, query_pb_service_1.Query.Params);
return response.getParams();
}
catch (e) {
throw new exceptions_1.GrpcException(e.message);
}
});
}
fetchValidators() {

@@ -24,0 +36,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -1,6 +0,10 @@

import { Validator as GrpcValidator, Delegation as GrpcDelegation, Description as GrpcValidatorDescription, Commission as GrpcValidatorCommission, CommissionRates as GrpcValidatorCommissionRates, UnbondingDelegation as GrpcUnbondingDelegation, Redelegation as GrpcReDelegation, DelegationResponse as GrpcDelegationResponse, RedelegationResponse as GrpcReDelegationResponse } from '@injectivelabs/chain-api/cosmos/staking/v1beta1/staking_pb';
import { DelegationDelegatorReward as GrpcDelegationDelegatorReward } from '@injectivelabs/chain-api/cosmos/distribution/v1beta1/distribution_pb';
import { Proposal as GrpcProposal, Deposit as GrpcProposalDeposit, TallyParams as GrpcTallyParams, TallyResult as GrpcTallyResult, Vote as GrpcVote, ProposalStatusMap as GrpcProposalStatus } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/gov_pb';
import { SpotMarket as GrpcSpotMarket, MarketStatus as GrpcMarketStatus, MarketStatusMap as GrpcMarketStatusMap, SpotLimitOrder as GrpcSpotLimitOrder, SpotMarketOrder as GrpcSpotMarketOrder, SpotOrder as GrpcSpotOrder } from '@injectivelabs/chain-api/injective/exchange/v1beta1/exchange_pb';
import { Supply as GrpcSupply } from '@injectivelabs/chain-api/cosmos/bank/v1beta1/bank_pb';
import { Validator as GrpcValidator, Delegation as GrpcDelegation, Description as GrpcValidatorDescription, Commission as GrpcValidatorCommission, CommissionRates as GrpcValidatorCommissionRates, UnbondingDelegation as GrpcUnbondingDelegation, Redelegation as GrpcReDelegation, DelegationResponse as GrpcDelegationResponse, RedelegationResponse as GrpcReDelegationResponse, Params as GrpcStakingParams } from '@injectivelabs/chain-api/cosmos/staking/v1beta1/staking_pb';
import { Params as GrpcInsuranceParams } from '@injectivelabs/chain-api/injective/insurance/v1beta1/insurance_pb';
import { Params as GrpcMintParams } from '@injectivelabs/chain-api/cosmos/mint/v1beta1/mint_pb';
import { Params as GrpcPeggyParams } from '@injectivelabs/chain-api/injective/peggy/v1/genesis_pb';
import { Params as GrpcOracleParams } from '@injectivelabs/chain-api/injective/oracle/v1beta1/oracle_pb';
import { DelegationDelegatorReward as GrpcDelegationDelegatorReward, Params as GrpcDistributionParams } from '@injectivelabs/chain-api/cosmos/distribution/v1beta1/distribution_pb';
import { Proposal as GrpcProposal, Deposit as GrpcProposalDeposit, TallyParams as GrpcGovernanceTallyParams, VotingParams as GrpcGovernanceVotingParams, DepositParams as GrpcGovernanceDepositParams, TallyResult as GrpcTallyResult, Vote as GrpcVote, ProposalStatusMap as GrpcProposalStatus } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/gov_pb';
import { SpotMarket as GrpcSpotMarket, MarketStatus as GrpcMarketStatus, MarketStatusMap as GrpcMarketStatusMap, SpotLimitOrder as GrpcSpotLimitOrder, SpotMarketOrder as GrpcSpotMarketOrder, SpotOrder as GrpcSpotOrder, Params as GrpcExchangeParams } from '@injectivelabs/chain-api/injective/exchange/v1beta1/exchange_pb';
import { Supply as GrpcSupply, Params as GrpcBankParams } from '@injectivelabs/chain-api/cosmos/bank/v1beta1/bank_pb';
import { Coin as GrpcCoin } from '@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb';

@@ -13,3 +17,3 @@ export interface PaginationOption {

}
export { GrpcCoin, GrpcValidator, GrpcDelegation, GrpcValidatorDescription, GrpcValidatorCommission, GrpcValidatorCommissionRates, GrpcUnbondingDelegation, GrpcDelegationResponse, GrpcProposal, GrpcProposalDeposit, GrpcTallyParams, GrpcTallyResult, GrpcVote, GrpcProposalStatus, GrpcSupply, GrpcDelegationDelegatorReward, GrpcSpotMarket, GrpcMarketStatus, GrpcMarketStatusMap, GrpcSpotLimitOrder, GrpcSpotMarketOrder, GrpcSpotOrder, GrpcReDelegation, GrpcReDelegationResponse, };
export { GrpcCoin, GrpcValidator, GrpcDelegation, GrpcValidatorDescription, GrpcValidatorCommission, GrpcValidatorCommissionRates, GrpcUnbondingDelegation, GrpcDelegationResponse, GrpcProposal, GrpcProposalDeposit, GrpcGovernanceTallyParams, GrpcGovernanceVotingParams, GrpcGovernanceDepositParams, GrpcTallyResult, GrpcVote, GrpcProposalStatus, GrpcSupply, GrpcDelegationDelegatorReward, GrpcSpotMarket, GrpcMarketStatus, GrpcMarketStatusMap, GrpcSpotLimitOrder, GrpcSpotMarketOrder, GrpcSpotOrder, GrpcReDelegation, GrpcReDelegationResponse, GrpcBankParams, GrpcDistributionParams, GrpcInsuranceParams, GrpcStakingParams, GrpcExchangeParams, GrpcMintParams, GrpcPeggyParams, GrpcOracleParams, };
//# sourceMappingURL=types.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GrpcReDelegationResponse = exports.GrpcReDelegation = exports.GrpcSpotOrder = exports.GrpcSpotMarketOrder = exports.GrpcSpotLimitOrder = exports.GrpcMarketStatus = exports.GrpcSpotMarket = exports.GrpcDelegationDelegatorReward = exports.GrpcSupply = exports.GrpcVote = exports.GrpcTallyResult = exports.GrpcTallyParams = exports.GrpcProposalDeposit = exports.GrpcProposal = exports.GrpcDelegationResponse = exports.GrpcUnbondingDelegation = exports.GrpcValidatorCommissionRates = exports.GrpcValidatorCommission = exports.GrpcValidatorDescription = exports.GrpcDelegation = exports.GrpcValidator = exports.GrpcCoin = void 0;
exports.GrpcOracleParams = exports.GrpcPeggyParams = exports.GrpcMintParams = exports.GrpcExchangeParams = exports.GrpcStakingParams = exports.GrpcInsuranceParams = exports.GrpcDistributionParams = exports.GrpcBankParams = exports.GrpcReDelegationResponse = exports.GrpcReDelegation = exports.GrpcSpotOrder = exports.GrpcSpotMarketOrder = exports.GrpcSpotLimitOrder = exports.GrpcMarketStatus = exports.GrpcSpotMarket = exports.GrpcDelegationDelegatorReward = exports.GrpcSupply = exports.GrpcVote = exports.GrpcTallyResult = exports.GrpcGovernanceDepositParams = exports.GrpcGovernanceVotingParams = exports.GrpcGovernanceTallyParams = exports.GrpcProposalDeposit = exports.GrpcProposal = exports.GrpcDelegationResponse = exports.GrpcUnbondingDelegation = exports.GrpcValidatorCommissionRates = exports.GrpcValidatorCommission = exports.GrpcValidatorDescription = exports.GrpcDelegation = exports.GrpcValidator = exports.GrpcCoin = void 0;
const staking_pb_1 = require("@injectivelabs/chain-api/cosmos/staking/v1beta1/staking_pb");

@@ -14,8 +14,20 @@ Object.defineProperty(exports, "GrpcValidator", { enumerable: true, get: function () { return staking_pb_1.Validator; } });

Object.defineProperty(exports, "GrpcReDelegationResponse", { enumerable: true, get: function () { return staking_pb_1.RedelegationResponse; } });
Object.defineProperty(exports, "GrpcStakingParams", { enumerable: true, get: function () { return staking_pb_1.Params; } });
const insurance_pb_1 = require("@injectivelabs/chain-api/injective/insurance/v1beta1/insurance_pb");
Object.defineProperty(exports, "GrpcInsuranceParams", { enumerable: true, get: function () { return insurance_pb_1.Params; } });
const mint_pb_1 = require("@injectivelabs/chain-api/cosmos/mint/v1beta1/mint_pb");
Object.defineProperty(exports, "GrpcMintParams", { enumerable: true, get: function () { return mint_pb_1.Params; } });
const genesis_pb_1 = require("@injectivelabs/chain-api/injective/peggy/v1/genesis_pb");
Object.defineProperty(exports, "GrpcPeggyParams", { enumerable: true, get: function () { return genesis_pb_1.Params; } });
const oracle_pb_1 = require("@injectivelabs/chain-api/injective/oracle/v1beta1/oracle_pb");
Object.defineProperty(exports, "GrpcOracleParams", { enumerable: true, get: function () { return oracle_pb_1.Params; } });
const distribution_pb_1 = require("@injectivelabs/chain-api/cosmos/distribution/v1beta1/distribution_pb");
Object.defineProperty(exports, "GrpcDelegationDelegatorReward", { enumerable: true, get: function () { return distribution_pb_1.DelegationDelegatorReward; } });
Object.defineProperty(exports, "GrpcDistributionParams", { enumerable: true, get: function () { return distribution_pb_1.Params; } });
const gov_pb_1 = require("@injectivelabs/chain-api/cosmos/gov/v1beta1/gov_pb");
Object.defineProperty(exports, "GrpcProposal", { enumerable: true, get: function () { return gov_pb_1.Proposal; } });
Object.defineProperty(exports, "GrpcProposalDeposit", { enumerable: true, get: function () { return gov_pb_1.Deposit; } });
Object.defineProperty(exports, "GrpcTallyParams", { enumerable: true, get: function () { return gov_pb_1.TallyParams; } });
Object.defineProperty(exports, "GrpcGovernanceTallyParams", { enumerable: true, get: function () { return gov_pb_1.TallyParams; } });
Object.defineProperty(exports, "GrpcGovernanceVotingParams", { enumerable: true, get: function () { return gov_pb_1.VotingParams; } });
Object.defineProperty(exports, "GrpcGovernanceDepositParams", { enumerable: true, get: function () { return gov_pb_1.DepositParams; } });
Object.defineProperty(exports, "GrpcTallyResult", { enumerable: true, get: function () { return gov_pb_1.TallyResult; } });

@@ -29,6 +41,8 @@ Object.defineProperty(exports, "GrpcVote", { enumerable: true, get: function () { return gov_pb_1.Vote; } });

Object.defineProperty(exports, "GrpcSpotOrder", { enumerable: true, get: function () { return exchange_pb_1.SpotOrder; } });
Object.defineProperty(exports, "GrpcExchangeParams", { enumerable: true, get: function () { return exchange_pb_1.Params; } });
const bank_pb_1 = require("@injectivelabs/chain-api/cosmos/bank/v1beta1/bank_pb");
Object.defineProperty(exports, "GrpcSupply", { enumerable: true, get: function () { return bank_pb_1.Supply; } });
Object.defineProperty(exports, "GrpcBankParams", { enumerable: true, get: function () { return bank_pb_1.Params; } });
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb");
Object.defineProperty(exports, "GrpcCoin", { enumerable: true, get: function () { return coin_pb_1.Coin; } });
//# sourceMappingURL=types.js.map
{
"name": "@injectivelabs/chain-consumer",
"description": "Interacting with our Chain API made easy. Can be reused throughout Injective's projects.",
"version": "0.0.68",
"version": "0.0.69",
"license": "MIT",

@@ -42,3 +42,3 @@ "main": "dist/index.js",

},
"gitHead": "f9ceb3cae076114e104b8a1448bf0f2542c9e032"
"gitHead": "afa86840ab0149e8fe6a5e47dfcffa519f112a28"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc