@injectivelabs/chain-consumer
Advanced tools
Comparing version 0.0.116 to 0.0.117
@@ -1,2 +0,4 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress } from '@injectivelabs/ts-types/dist/index'; | ||
import { MsgBid } from '@injectivelabs/chain-api/injective/auction/v1beta1/tx_pb'; | ||
import { ComposerResponse } from '@injectivelabs/ts-types'; | ||
export declare class AuctionComposer { | ||
@@ -8,6 +10,4 @@ static bid({ amount, round, denom, injectiveAddress, }: { | ||
injectiveAddress: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgBid, MsgBid.AsObject>; | ||
} | ||
//# sourceMappingURL=AuctionComposer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AuctionComposer = void 0; | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const tx_pb_1 = require("@injectivelabs/chain-api/injective/auction/v1beta1/tx_pb"); | ||
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class AuctionComposer { | ||
@@ -19,3 +16,10 @@ static bid({ amount, round, denom = 'inj', injectiveAddress, }) { | ||
message.setSender(injectiveAddress); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/injective.auction.v1beta1.MsgBid' }); | ||
const type = '/injective.auction.v1beta1.MsgBid'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -22,0 +26,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgSend } from '@injectivelabs/chain-api/cosmos/bank/v1beta1/tx_pb'; | ||
export declare class BankComposer { | ||
@@ -8,9 +9,4 @@ static send({ amount, denom, srcInjectiveAddress, dstInjectiveAddress, }: { | ||
dstInjectiveAddress: AccountAddress; | ||
}): { | ||
amount: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgSend, MsgSend.AsObject>; | ||
} | ||
//# sourceMappingURL=BankComposer.d.ts.map |
@@ -10,2 +10,3 @@ "use strict"; | ||
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class BankComposer { | ||
@@ -16,9 +17,17 @@ static send({ amount, denom, srcInjectiveAddress, dstInjectiveAddress, }) { | ||
amountToSend.setDenom(denom); | ||
const type = '/cosmos.bank.v1beta1.MsgSend'; | ||
const message = new tx_pb_1.MsgSend(); | ||
message.setFromAddress(srcInjectiveAddress); | ||
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' }); | ||
message.setAmountList([amountToSend]); | ||
const messageObj = Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { amount: [Object.assign({}, (0, snakecase_keys_1.default)(amountToSend.toObject()))] }); | ||
// @ts-ignore | ||
delete messageObj.amount_list; | ||
return messageObj; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(messageObj, type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -25,0 +34,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgWithdrawDelegatorReward } from '@injectivelabs/chain-api/cosmos/distribution/v1beta1/tx_pb'; | ||
export declare class DistributionComposer { | ||
@@ -6,4 +7,4 @@ static withdrawDelegatorReward({ delegatorAddress, validatorAddress, }: { | ||
delegatorAddress: AccountAddress; | ||
}): Record<string, any>; | ||
}): ComposerResponse<MsgWithdrawDelegatorReward, MsgWithdrawDelegatorReward.AsObject>; | ||
} | ||
//# sourceMappingURL=DistributionComposer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DistributionComposer = void 0; | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const tx_pb_1 = require("@injectivelabs/chain-api/cosmos/distribution/v1beta1/tx_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class DistributionComposer { | ||
static withdrawDelegatorReward({ delegatorAddress, validatorAddress, }) { | ||
const cosmosMessage = new tx_pb_1.MsgWithdrawDelegatorReward(); | ||
cosmosMessage.setDelegatorAddress(delegatorAddress); | ||
cosmosMessage.setValidatorAddress(validatorAddress); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward' }); | ||
const message = new tx_pb_1.MsgWithdrawDelegatorReward(); | ||
message.setDelegatorAddress(delegatorAddress); | ||
message.setValidatorAddress(validatorAddress); | ||
const type = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -16,0 +20,0 @@ } |
@@ -1,3 +0,4 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { ExpiryFuturesMarketLaunchProposal, PerpetualMarketLaunchProposal, MsgInstantSpotMarketLaunch, SpotMarketLaunchProposal, SpotMarketParamUpdateProposal } from '@injectivelabs/chain-api/injective/exchange/v1beta1/tx_pb'; | ||
import { MsgSubmitProposal } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/tx_pb'; | ||
import { DepositProposalParams } from '../types'; | ||
@@ -8,5 +9,3 @@ export declare class ExchangeProposalComposer { | ||
proposer: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgInstantSpotMarketLaunch, MsgInstantSpotMarketLaunch.AsObject>; | ||
static spotMarketLaunch({ market, deposit, proposer, }: { | ||
@@ -16,12 +15,3 @@ market: SpotMarketLaunchProposal.AsObject; | ||
deposit: DepositProposalParams; | ||
}): { | ||
proposer: string; | ||
content: { | ||
'@type': string; | ||
}; | ||
initial_deposit: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgSubmitProposal, MsgSubmitProposal.AsObject>; | ||
static spotMarketUpdate({ market, deposit, proposer, }: { | ||
@@ -31,12 +21,3 @@ market: SpotMarketParamUpdateProposal.AsObject; | ||
deposit: DepositProposalParams; | ||
}): { | ||
proposer: string; | ||
content: { | ||
'@type': string; | ||
}; | ||
initial_deposit: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgSubmitProposal, MsgSubmitProposal.AsObject>; | ||
static perpetualMarketLaunch({ market, deposit, proposer, }: { | ||
@@ -46,12 +27,3 @@ market: PerpetualMarketLaunchProposal.AsObject; | ||
deposit: DepositProposalParams; | ||
}): { | ||
proposer: string; | ||
content: { | ||
'@type': string; | ||
}; | ||
initial_deposit: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgSubmitProposal, MsgSubmitProposal.AsObject>; | ||
static expiryFuturesMarketLaunch({ market, deposit, proposer, }: { | ||
@@ -61,12 +33,3 @@ market: ExpiryFuturesMarketLaunchProposal.AsObject; | ||
deposit: DepositProposalParams; | ||
}): { | ||
proposer: string; | ||
content: { | ||
'@type': string; | ||
}; | ||
initial_deposit: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgSubmitProposal, MsgSubmitProposal.AsObject>; | ||
static derivativeMarketUpdate(): void; | ||
@@ -73,0 +36,0 @@ static derivativeMarketStatusUpdate(): void; |
@@ -10,12 +10,22 @@ "use strict"; | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const tx_pb_2 = require("@injectivelabs/chain-api/cosmos/gov/v1beta1/tx_pb"); | ||
const any_pb_1 = require("google-protobuf/google/protobuf/any_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class ExchangeProposalComposer { | ||
static instantSpotMarketLaunch({ market, proposer, }) { | ||
const content = new tx_pb_1.MsgInstantSpotMarketLaunch(); | ||
content.setSender(proposer); | ||
content.setQuoteDenom(market.quoteDenom); | ||
content.setTicker(market.ticker); | ||
content.setBaseDenom(market.baseDenom); | ||
content.setMinPriceTickSize(market.minPriceTickSize); | ||
content.setMinQuantityTickSize(market.minQuantityTickSize); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(content.toObject())), { '@type': '/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch' }); | ||
const message = new tx_pb_1.MsgInstantSpotMarketLaunch(); | ||
message.setSender(proposer); | ||
message.setQuoteDenom(market.quoteDenom); | ||
message.setTicker(market.ticker); | ||
message.setBaseDenom(market.baseDenom); | ||
message.setMinPriceTickSize(market.minPriceTickSize); | ||
message.setMinQuantityTickSize(market.minQuantityTickSize); | ||
const type = '/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -36,7 +46,21 @@ static spotMarketLaunch({ market, deposit, proposer, }) { | ||
content.setTakerFeeRate(market.makerFeeRate); | ||
const proposalType = '/injective.exchange.v1beta1.SpotMarketLaunchProposal'; | ||
const type = '/cosmos.gov.v1beta1.MsgSubmitProposal'; | ||
const contentAny = new any_pb_1.Any(); | ||
contentAny.setValue(content.serializeBinary()); | ||
contentAny.setTypeUrl(proposalType); | ||
const message = new tx_pb_2.MsgSubmitProposal(); | ||
message.setContent(contentAny); | ||
message.setProposer(proposer); | ||
message.setInitialDepositList([depositParams]); | ||
return { | ||
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()))], | ||
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal', | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)({ | ||
proposer, | ||
content: Object.assign({ '@type': proposalType }, (0, snakecase_keys_1.default)(message.toObject())), | ||
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))], | ||
}, type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
@@ -57,7 +81,21 @@ } | ||
content.setMinQuantityTickSize(market.minQuantityTickSize); | ||
const proposalType = '/injective.exchange.v1beta1.SpotMarketParamUpdateProposal'; | ||
const type = '/cosmos.gov.v1beta1.MsgSubmitProposal'; | ||
const contentAny = new any_pb_1.Any(); | ||
contentAny.setValue(content.serializeBinary()); | ||
contentAny.setTypeUrl(proposalType); | ||
const message = new tx_pb_2.MsgSubmitProposal(); | ||
message.setContent(contentAny); | ||
message.setProposer(proposer); | ||
message.setInitialDepositList([depositParams]); | ||
return { | ||
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()))], | ||
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal', | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)({ | ||
proposer, | ||
content: Object.assign({ '@type': proposalType }, (0, snakecase_keys_1.default)(content.toObject())), | ||
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))], | ||
}, type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
@@ -84,7 +122,18 @@ } | ||
content.setMinQuantityTickSize(market.minQuantityTickSize); | ||
const proposalType = '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal'; | ||
const type = '/cosmos.gov.v1beta1.MsgSubmitProposal'; | ||
const contentAny = new any_pb_1.Any(); | ||
contentAny.setValue(content.serializeBinary()); | ||
contentAny.setTypeUrl(proposalType); | ||
const message = new tx_pb_2.MsgSubmitProposal(); | ||
message.setContent(contentAny); | ||
message.setProposer(proposer); | ||
message.setInitialDepositList([depositParams]); | ||
return { | ||
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()))], | ||
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal', | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)({ | ||
proposer, | ||
content: Object.assign({ '@type': proposalType }, (0, snakecase_keys_1.default)(message.toObject())), | ||
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))], | ||
}, type), | ||
directBroadcastMessage: { message, type }, | ||
}; | ||
@@ -112,7 +161,21 @@ } | ||
content.setMinQuantityTickSize(market.minQuantityTickSize); | ||
const proposalType = '/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal'; | ||
const type = '/cosmos.gov.v1beta1.MsgSubmitProposal'; | ||
const contentAny = new any_pb_1.Any(); | ||
contentAny.setValue(content.serializeBinary()); | ||
contentAny.setTypeUrl(proposalType); | ||
const message = new tx_pb_2.MsgSubmitProposal(); | ||
message.setContent(contentAny); | ||
message.setProposer(proposer); | ||
message.setInitialDepositList([depositParams]); | ||
return { | ||
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()))], | ||
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal', | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)({ | ||
proposer, | ||
content: Object.assign({ '@type': proposalType }, (0, snakecase_keys_1.default)(message.toObject())), | ||
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))], | ||
}, type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
@@ -119,0 +182,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgVote, MsgDeposit } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/tx_pb'; | ||
import { VoteOptionMap } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/gov_pb'; | ||
@@ -8,5 +9,3 @@ export declare class GovernanceComposer { | ||
voter: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgVote, MsgVote.AsObject>; | ||
static deposit({ proposalId, amount, denom, depositor, }: { | ||
@@ -17,9 +16,4 @@ proposalId: number; | ||
depositor: AccountAddress; | ||
}): { | ||
amount: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgDeposit, MsgDeposit.AsObject>; | ||
} | ||
//# sourceMappingURL=GovernanceComposer.d.ts.map |
@@ -10,2 +10,3 @@ "use strict"; | ||
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class GovernanceComposer { | ||
@@ -17,3 +18,10 @@ static vote({ proposalId, vote, voter, }) { | ||
message.setVoter(voter); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/cosmos.gov.v1beta1.MsgVote' }); | ||
const type = '/cosmos.gov.v1beta1.MsgVote'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -27,6 +35,13 @@ 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 type = '/cosmos.gov.v1beta1.MsgDeposit'; | ||
const messageObj = Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { amount: [Object.assign({}, (0, snakecase_keys_1.default)(deposit.toObject()))] }); | ||
// @ts-ignore | ||
delete messageObj.amount_list; | ||
return messageObj; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(messageObj, type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -33,0 +48,0 @@ } |
@@ -0,1 +1,3 @@ | ||
import { MsgTransfer } from '@injectivelabs/chain-api/ibc/applications/transfer/v1/tx_pb'; | ||
import { ComposerResponse } from '@injectivelabs/ts-types'; | ||
export declare class IBCComposer { | ||
@@ -14,6 +16,4 @@ static transfer({ receiver, sender, channelId, port, denom, amount, timeout, height, }: { | ||
}; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgTransfer, MsgTransfer.AsObject>; | ||
} | ||
//# sourceMappingURL=IBCComposer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IBCComposer = void 0; | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const tx_pb_1 = require("@injectivelabs/chain-api/ibc/applications/transfer/v1/tx_pb"); | ||
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"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class IBCComposer { | ||
@@ -35,3 +32,7 @@ static transfer({ receiver, sender, channelId, port, denom, amount, timeout, height, }) { | ||
} | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/ibc.applications.transfer.v1.MsgTransfer' }); | ||
const type = '/ibc.applications.transfer.v1.MsgTransfer'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { message, type }, | ||
}; | ||
} | ||
@@ -38,0 +39,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgCreateInsuranceFund, MsgRequestRedemption, MsgUnderwrite } from '@injectivelabs/chain-api/injective/insurance/v1beta1/tx_pb'; | ||
import { OracleTypeMap } from '@injectivelabs/chain-api/injective/oracle/v1beta1/oracle_pb'; | ||
@@ -9,5 +10,3 @@ export declare class InsuranceComposer { | ||
injectiveAddress: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgUnderwrite, MsgUnderwrite.AsObject>; | ||
static requestRedemption({ marketId, amount, denom, injectiveAddress, }: { | ||
@@ -18,5 +17,3 @@ marketId: string; | ||
injectiveAddress: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgRequestRedemption, MsgRequestRedemption.AsObject>; | ||
static createInsuranceFund({ fund, deposit, injectiveAddress, }: { | ||
@@ -36,6 +33,4 @@ fund: { | ||
injectiveAddress: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgCreateInsuranceFund, MsgCreateInsuranceFund.AsObject>; | ||
} | ||
//# sourceMappingURL=InsuranceComposer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InsuranceComposer = void 0; | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const tx_pb_1 = require("@injectivelabs/chain-api/injective/insurance/v1beta1/tx_pb"); | ||
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class InsuranceComposer { | ||
@@ -19,3 +16,10 @@ static underwrite({ marketId, amount, denom, injectiveAddress, }) { | ||
message.setSender(injectiveAddress); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgUnderwrite' }); | ||
const type = '/injective.insurance.v1beta1.MsgUnderwrite'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -30,3 +34,10 @@ 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' }); | ||
const type = '/injective.insurance.v1beta1.MsgRequestRedemption'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -46,3 +57,10 @@ 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' }); | ||
const type = '/injective.insurance.v1beta1.MsgCreateInsuranceFund'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -49,0 +67,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgSendToEth } from '@injectivelabs/chain-api/injective/peggy/v1/msgs_pb'; | ||
export declare class PeggyComposer { | ||
@@ -10,4 +11,4 @@ static withdraw({ address, injectiveAddress, amount, denom, bridgeFeeDenom, bridgeFeeAmount, }: { | ||
bridgeFeeAmount?: string; | ||
}): Record<string, any>; | ||
}): ComposerResponse<MsgSendToEth, MsgSendToEth.AsObject>; | ||
} | ||
//# sourceMappingURL=PeggyComposer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -10,3 +7,2 @@ exports.PeggyComposer = void 0; | ||
const msgs_pb_1 = require("@injectivelabs/chain-api/injective/peggy/v1/msgs_pb"); | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
class PeggyComposer { | ||
@@ -20,8 +16,12 @@ static withdraw({ address, injectiveAddress, amount, denom, bridgeFeeDenom = utils_1.DEFAULT_BRIDGE_FEE_DENOM, bridgeFeeAmount = utils_1.DEFAULT_BRIDGE_FEE_AMOUNT, }) { | ||
bridgeFee.setAmount(bridgeFeeAmount); | ||
const cosmosMessage = new msgs_pb_1.MsgSendToEth(); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setSender(injectiveAddress); | ||
cosmosMessage.setEthDest(address); | ||
cosmosMessage.setBridgeFee(bridgeFee); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/injective.peggy.v1.MsgSendToEth' }); | ||
const message = new msgs_pb_1.MsgSendToEth(); | ||
message.setAmount(coinAmount); | ||
message.setSender(injectiveAddress); | ||
message.setEthDest(address); | ||
message.setBridgeFee(bridgeFee); | ||
const type = '/injective.peggy.v1.MsgSendToEth'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { message, type }, | ||
}; | ||
} | ||
@@ -28,0 +28,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgSubmitProposal } from '@injectivelabs/chain-api/cosmos/gov/v1beta1/tx_pb'; | ||
import { DepositProposalParams } from '../types'; | ||
@@ -9,13 +10,4 @@ export declare class ProposalComposer { | ||
deposit: DepositProposalParams; | ||
}): { | ||
proposer: string; | ||
content: { | ||
'@type': string; | ||
}; | ||
initial_deposit: { | ||
[x: string]: any; | ||
}[]; | ||
'@type': string; | ||
}; | ||
}): ComposerResponse<MsgSubmitProposal, MsgSubmitProposal.AsObject>; | ||
} | ||
//# sourceMappingURL=ProposalComposer.d.ts.map |
@@ -10,2 +10,5 @@ "use strict"; | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const any_pb_1 = require("google-protobuf/google/protobuf/any_pb"); | ||
const tx_pb_1 = require("@injectivelabs/chain-api/cosmos/gov/v1beta1/tx_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class ProposalComposer { | ||
@@ -19,7 +22,21 @@ static textProposal({ title, description, deposit, proposer, }) { | ||
content.setDescription(description); | ||
const proposalType = '/injective.exchange.v1beta1.TextProposal'; | ||
const type = '/cosmos.gov.v1beta1.MsgSubmitProposal'; | ||
const contentAny = new any_pb_1.Any(); | ||
contentAny.setValue(content.serializeBinary()); | ||
contentAny.setTypeUrl(proposalType); | ||
const message = new tx_pb_1.MsgSubmitProposal(); | ||
message.setContent(contentAny); | ||
message.setProposer(proposer); | ||
message.setInitialDepositList([depositParams]); | ||
return { | ||
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()))], | ||
'@type': '/cosmos.gov.v1beta1.MsgSubmitProposal', | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)({ | ||
proposer, | ||
content: Object.assign({ '@type': proposalType }, (0, snakecase_keys_1.default)(message.toObject())), | ||
initial_deposit: [Object.assign({}, (0, snakecase_keys_1.default)(depositParams.toObject()))], | ||
}, type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
@@ -26,0 +43,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { AccountAddress, ComposerResponse } from '@injectivelabs/ts-types'; | ||
import { MsgBeginRedelegate, MsgDelegate, MsgUndelegate } from '@injectivelabs/chain-api/cosmos/staking/v1beta1/tx_pb'; | ||
export declare class StakingComposer { | ||
@@ -8,3 +9,3 @@ static delegate({ injectiveAddress, validatorAddress, amount, denom, }: { | ||
amount: string; | ||
}): Record<string, any>; | ||
}): ComposerResponse<MsgDelegate, MsgDelegate.AsObject>; | ||
static reDelegate({ injectiveAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }: { | ||
@@ -16,3 +17,3 @@ denom: string; | ||
amount: string; | ||
}): Record<string, any>; | ||
}): ComposerResponse<MsgBeginRedelegate, MsgBeginRedelegate.AsObject>; | ||
static unbond({ injectiveAddress, validatorAddress, amount, denom, }: { | ||
@@ -23,4 +24,4 @@ denom: string; | ||
amount: string; | ||
}): Record<string, any>; | ||
}): ComposerResponse<MsgUndelegate, MsgUndelegate.AsObject>; | ||
} | ||
//# sourceMappingURL=StakingComposer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StakingComposer = void 0; | ||
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb"); | ||
const snakecase_keys_1 = __importDefault(require("snakecase-keys")); | ||
const tx_pb_1 = require("@injectivelabs/chain-api/cosmos/staking/v1beta1/tx_pb"); | ||
const utils_1 = require("@injectivelabs/utils"); | ||
class StakingComposer { | ||
@@ -15,7 +12,14 @@ static delegate({ injectiveAddress, validatorAddress, amount, denom, }) { | ||
coinAmount.setAmount(amount); | ||
const cosmosMessage = new tx_pb_1.MsgDelegate(); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setDelegatorAddress(injectiveAddress); | ||
cosmosMessage.setValidatorAddress(validatorAddress); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgDelegate' }); | ||
const message = new tx_pb_1.MsgDelegate(); | ||
message.setAmount(coinAmount); | ||
message.setDelegatorAddress(injectiveAddress); | ||
message.setValidatorAddress(validatorAddress); | ||
const type = '/cosmos.staking.v1beta1.MsgDelegate'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -26,8 +30,15 @@ static reDelegate({ injectiveAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }) { | ||
coinAmount.setAmount(amount); | ||
const cosmosMessage = new tx_pb_1.MsgBeginRedelegate(); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setDelegatorAddress(injectiveAddress); | ||
cosmosMessage.setValidatorDstAddress(destinationValidatorAddress); | ||
cosmosMessage.setValidatorSrcAddress(sourceValidatorAddress); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgBeginRedelegate' }); | ||
const message = new tx_pb_1.MsgBeginRedelegate(); | ||
message.setAmount(coinAmount); | ||
message.setDelegatorAddress(injectiveAddress); | ||
message.setValidatorDstAddress(destinationValidatorAddress); | ||
message.setValidatorSrcAddress(sourceValidatorAddress); | ||
const type = '/cosmos.staking.v1beta1.MsgBeginRedelegate'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -38,7 +49,14 @@ static unbond({ injectiveAddress, validatorAddress, amount, denom, }) { | ||
coinAmount.setAmount(amount); | ||
const cosmosMessage = new tx_pb_1.MsgUndelegate(); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setDelegatorAddress(injectiveAddress); | ||
cosmosMessage.setValidatorAddress(validatorAddress); | ||
return Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgUndelegate' }); | ||
const message = new tx_pb_1.MsgUndelegate(); | ||
message.setAmount(coinAmount); | ||
message.setDelegatorAddress(injectiveAddress); | ||
message.setValidatorAddress(validatorAddress); | ||
const type = '/cosmos.staking.v1beta1.MsgUndelegate'; | ||
return { | ||
web3GatewayMessage: (0, utils_1.getWeb3GatewayMessage)(message.toObject(), type), | ||
directBroadcastMessage: { | ||
message, | ||
type, | ||
}, | ||
}; | ||
} | ||
@@ -45,0 +63,0 @@ } |
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
export declare class AuthConsumer extends BaseConsumer { | ||
fetchAddressDetails(address: string): Promise<any>; | ||
fetchAddressDetails(address: string): Promise<import("google-protobuf/google/protobuf/any_pb").Any | undefined>; | ||
getCosmosAddress: ({ address, type, prefix, }: { | ||
@@ -8,0 +8,0 @@ address: AccountAddress | Buffer; |
@@ -5,4 +5,3 @@ export * from './consumers'; | ||
export * from './transformers'; | ||
export * from './proto-composers'; | ||
export * from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -17,4 +17,3 @@ "use strict"; | ||
__exportStar(require("./transformers"), exports); | ||
__exportStar(require("./proto-composers"), exports); | ||
__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@injectivelabs/chain-consumer", | ||
"description": "Interacting with our Chain API made easy. Can be reused throughout Injective's projects.", | ||
"version": "0.0.116", | ||
"version": "0.0.117", | ||
"license": "MIT", | ||
@@ -34,6 +34,7 @@ "main": "dist/index.js", | ||
"@injectivelabs/exceptions": "^0.0.26", | ||
"@injectivelabs/ts-types": "^0.0.22", | ||
"@injectivelabs/utils": "^0.0.33", | ||
"@injectivelabs/ts-types": "^0.0.41", | ||
"@injectivelabs/utils": "^0.0.64", | ||
"bech32": "^2.0.0", | ||
"ethereumjs-util": "^7.0.10", | ||
"google-protobuf": "^3.20.0-rc.1", | ||
"link-module-alias": "^1.2.0", | ||
@@ -43,3 +44,3 @@ "shx": "^0.3.2", | ||
}, | ||
"gitHead": "3266b85e0331fd9f2bf87f02efc9cf90e7ce85a2" | ||
"gitHead": "a04fe2b57ef24f7bb0c3cb57a53f3414ba3577a8" | ||
} |
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
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
209755
12
143
2542
+ Addedgoogle-protobuf@^3.20.0-rc.1
+ Added@injectivelabs/exceptions@0.0.46(transitive)
+ Added@injectivelabs/ts-types@0.0.41(transitive)
+ Added@injectivelabs/utils@0.0.64(transitive)
+ Addeddot-case@3.0.4(transitive)
+ Addedlower-case@2.0.2(transitive)
+ Addedno-case@3.0.4(transitive)
+ Addedsnake-case@3.0.4(transitive)
+ Addedsnakecase-keys@5.5.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-fest@3.13.1(transitive)
- Removed@injectivelabs/utils@0.0.33(transitive)
- Removed@injectivelabs/web3-contract-typings@0.1.13(transitive)
- Removed@types/ethereumjs-util@6.1.2(transitive)
- Removedtypescript@4.9.5(transitive)
Updated@injectivelabs/utils@^0.0.64