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

to
0.0.85

4

dist/BaseConsumer.js

@@ -7,4 +7,4 @@ "use strict";

const grpc_web_node_http_transport_1 = require("@improbable-eng/grpc-web-node-http-transport");
if ((0, utils_1.isServerSide)()) {
grpc_web_1.grpc.setDefaultTransport((0, grpc_web_node_http_transport_1.NodeHttpTransport)());
if (utils_1.isServerSide()) {
grpc_web_1.grpc.setDefaultTransport(grpc_web_node_http_transport_1.NodeHttpTransport());
}

@@ -11,0 +11,0 @@ class BaseConsumer {

@@ -18,3 +18,3 @@ "use strict";

message.setToAddress(dstInjectiveAddress);
const messageObj = Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { amount: [Object.assign({}, (0, snakecase_keys_1.default)(amountToSend.toObject()))], '@type': '/cosmos.bank.v1beta1.MsgSend' });
const messageObj = Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { amount: [Object.assign({}, snakecase_keys_1.default(amountToSend.toObject()))], '@type': '/cosmos.bank.v1beta1.MsgSend' });
delete messageObj.amount_list;

@@ -21,0 +21,0 @@ return messageObj;

@@ -14,3 +14,3 @@ "use strict";

cosmosMessage.setValidatorAddress(validatorAddress);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward' });
}

@@ -17,0 +17,0 @@ }

@@ -25,4 +25,4 @@ "use strict";

proposer,
content: Object.assign({ '@type': '/injective.exchange.v1beta1.SpotMarketLaunchProposal' }, (0, snakecase_keys_1.default)(content.toObject())),
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))],
content: Object.assign({ '@type': '/injective.exchange.v1beta1.SpotMarketLaunchProposal' }, snakecase_keys_1.default(content.toObject())),
initial_deposit: [Object.assign({}, snakecase_keys_1.default(depositParams.toObject()))],
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',

@@ -46,4 +46,4 @@ };

proposer,
content: Object.assign({ '@type': '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal' }, (0, snakecase_keys_1.default)(content.toObject())),
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))],
content: Object.assign({ '@type': '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal' }, snakecase_keys_1.default(content.toObject())),
initial_deposit: [Object.assign({}, snakecase_keys_1.default(depositParams.toObject()))],
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',

@@ -73,4 +73,4 @@ };

proposer,
content: Object.assign({ '@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal' }, (0, snakecase_keys_1.default)(content.toObject())),
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))],
content: Object.assign({ '@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal' }, snakecase_keys_1.default(content.toObject())),
initial_deposit: [Object.assign({}, snakecase_keys_1.default(depositParams.toObject()))],
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',

@@ -101,4 +101,4 @@ };

proposer,
content: Object.assign({ '@type': '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal' }, (0, snakecase_keys_1.default)(content.toObject())),
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))],
content: Object.assign({ '@type': '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal' }, snakecase_keys_1.default(content.toObject())),
initial_deposit: [Object.assign({}, snakecase_keys_1.default(depositParams.toObject()))],
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',

@@ -105,0 +105,0 @@ };

@@ -16,3 +16,3 @@ "use strict";

message.setVoter(voter);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/cosmos.gov.v1beta1.MsgVote' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/cosmos.gov.v1beta1.MsgVote' });
}

@@ -26,3 +26,3 @@ static deposit({ proposalId, amount, denom, depositor, }) {

message.setProposalId(proposalId);
const messageObj = Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { amount: [Object.assign({}, (0, snakecase_keys_1.default)(deposit.toObject()))], '@type': '/cosmos.gov.v1beta1.MsgDeposit' });
const messageObj = Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { amount: [Object.assign({}, snakecase_keys_1.default(deposit.toObject()))], '@type': '/cosmos.gov.v1beta1.MsgDeposit' });
delete messageObj.amount_list;

@@ -29,0 +29,0 @@ return messageObj;

export declare class IBCComposer {
static transfer({ receiver, sender, channelId, port, denom, amount, }: {
static transfer({ receiver, sender, channelId, port, denom, amount, timeout, height, }: {
denom: string;

@@ -9,2 +9,7 @@ amount: string;

channelId: string;
timeout?: number;
height?: {
versionHeight: number;
versionNumber: number;
};
}): {

@@ -11,0 +16,0 @@ '@type': string;

@@ -10,4 +10,5 @@ "use strict";

const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb");
const client_pb_1 = require("@injectivelabs/chain-api/ibc/core/client/v1/client_pb");
class IBCComposer {
static transfer({ receiver, sender, channelId, port, denom, amount, }) {
static transfer({ receiver, sender, channelId, port, denom, amount, timeout, height, }) {
const token = new coin_pb_1.Coin();

@@ -22,3 +23,12 @@ token.setDenom(denom);

message.setToken(token);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/ibc.applications.transfer.v1.MsgTransfer' });
if (height) {
const timeoutHeight = new client_pb_1.Height();
timeoutHeight.setVersionHeight(height.versionHeight);
timeoutHeight.setVersionNumber(height.versionNumber);
message.setTimeoutHeight(timeoutHeight);
}
if (timeout) {
message.setTimeoutTimestamp(timeout);
}
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/ibc.applications.transfer.v1.MsgTransfer' });
}

@@ -25,0 +35,0 @@ }

@@ -19,3 +19,3 @@ "use strict";

message.setSender(injectiveAddress);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgUnderwrite' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgUnderwrite' });
}

@@ -30,3 +30,3 @@ static requestRedemption({ marketId, amount, denom, injectiveAddress, }) {

message.setSender(injectiveAddress);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgRequestRedemption' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgRequestRedemption' });
}

@@ -46,3 +46,3 @@ static createInsuranceFund({ fund, deposit, injectiveAddress, }) {

message.setExpiry(fund.expiry ? fund.expiry : -1);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgCreateInsuranceFund' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgCreateInsuranceFund' });
}

@@ -49,0 +49,0 @@ }

@@ -24,3 +24,3 @@ "use strict";

cosmosMessage.setBridgeFee(bridgeFee);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/injective.peggy.v1.MsgSendToEth' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/injective.peggy.v1.MsgSendToEth' });
}

@@ -27,0 +27,0 @@ }

@@ -20,4 +20,4 @@ "use strict";

proposer,
content: Object.assign({ '@type': '/cosmos.gov.v1beta1.TextProposal' }, (0, snakecase_keys_1.default)(content.toObject())),
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))],
content: Object.assign({ '@type': '/cosmos.gov.v1beta1.TextProposal' }, snakecase_keys_1.default(content.toObject())),
initial_deposit: [Object.assign({}, snakecase_keys_1.default(depositParams.toObject()))],
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',

@@ -24,0 +24,0 @@ };

@@ -19,3 +19,3 @@ "use strict";

cosmosMessage.setValidatorAddress(validatorAddress);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgDelegate' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgDelegate' });
}

@@ -31,3 +31,3 @@ static reDelegate({ injectiveAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }) {

cosmosMessage.setValidatorSrcAddress(sourceValidatorAddress);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgBeginRedelegate' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgBeginRedelegate' });
}

@@ -42,3 +42,3 @@ static unbond({ injectiveAddress, validatorAddress, amount, denom, }) {

cosmosMessage.setValidatorAddress(validatorAddress);
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgUndelegate' });
return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgUndelegate' });
}

@@ -45,0 +45,0 @@ }

@@ -64,3 +64,3 @@ "use strict";

const request = new query_pb_1.QueryTotalSupplyRequest();
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -67,0 +67,0 @@ request.setPagination(paginationForRequest);

@@ -63,3 +63,3 @@ "use strict";

request.setProposalStatus(status);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -97,3 +97,3 @@ request.setPagination(paginationForRequest);

request.setProposalId(proposalId);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -118,3 +118,3 @@ request.setPagination(paginationForRequest);

request.setProposalId(proposalId);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -121,0 +121,0 @@ request.setPagination(paginationForRequest);

@@ -66,3 +66,3 @@ "use strict";

request.setValidatorAddr(validatorAddress);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -87,3 +87,3 @@ request.setPagination(paginationForRequest);

request.setValidatorAddr(validatorAddress);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -122,3 +122,3 @@ request.setPagination(paginationForRequest);

request.setDelegatorAddr(injectiveAddress);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -143,3 +143,3 @@ request.setPagination(paginationForRequest);

request.setValidatorAddr(validatorAddress);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -178,3 +178,3 @@ request.setPagination(paginationForRequest);

request.setDelegatorAddr(injectiveAddress);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -199,3 +199,3 @@ request.setPagination(paginationForRequest);

request.setDelegatorAddr(injectiveAddress);
const paginationForRequest = (0, utils_1.paginationRequestFromPagination)(pagination);
const paginationForRequest = utils_1.paginationRequestFromPagination(pagination);
if (paginationForRequest) {

@@ -202,0 +202,0 @@ request.setPagination(paginationForRequest);

import { MsgTransfer } from '@injectivelabs/chain-api/ibc/applications/transfer/v1/transfer_pb';
export declare class IBCProtoComposer {
static transfer({ receiver, sender, channelId, port, denom, amount, }: {
static transfer({ receiver, sender, channelId, port, denom, amount, timeout, height, }: {
denom: string;

@@ -10,2 +10,7 @@ amount: string;

channelId: string;
timeout?: number;
height?: {
versionHeight: number;
versionNumber: number;
};
}): {

@@ -12,0 +17,0 @@ message: MsgTransfer;

@@ -6,4 +6,5 @@ "use strict";

const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb");
const client_pb_1 = require("@injectivelabs/chain-api/ibc/core/client/v1/client_pb");
class IBCProtoComposer {
static transfer({ receiver, sender, channelId, port, denom, amount, }) {
static transfer({ receiver, sender, channelId, port, denom, amount, timeout, height, }) {
const token = new coin_pb_1.Coin();

@@ -18,2 +19,11 @@ token.setDenom(denom);

message.setToken(token);
if (height) {
const timeoutHeight = new client_pb_1.Height();
timeoutHeight.setVersionHeight(height.versionHeight);
timeoutHeight.setVersionNumber(height.versionNumber);
message.setTimeoutHeight(timeoutHeight);
}
if (timeout) {
message.setTimeoutTimestamp(timeout);
}
return {

@@ -20,0 +30,0 @@ message,

{
"name": "@injectivelabs/chain-consumer",
"description": "Interacting with our Chain API made easy. Can be reused throughout Injective's projects.",
"version": "0.0.84",
"version": "0.0.85",
"license": "MIT",

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

},
"gitHead": "4c56fbf5ea217c8d841fbc063ca1a8d9773d5817"
"gitHead": "1c2d9dcebb82ce32cbd198732a4e33ac3c683a81"
}

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet