@injectivelabs/chain-consumer
Advanced tools
Comparing version
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.0.67](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/chain-consumer@0.0.66...@injectivelabs/chain-consumer@0.0.67) (2021-08-05) | ||
**Note:** Version bump only for package @injectivelabs/chain-consumer | ||
## [0.0.66](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/chain-consumer@0.0.65...@injectivelabs/chain-consumer@0.0.66) (2021-07-31) | ||
@@ -8,0 +16,0 @@ |
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
export declare class InsuranceComposer { | ||
static underwrite({ marketId, amount, denom, address, }: { | ||
static underwrite({ marketId, amount, denom, injectiveAddress, }: { | ||
marketId: string; | ||
denom: string; | ||
amount: string; | ||
address: AccountAddress; | ||
injectiveAddress: AccountAddress; | ||
}): { | ||
'@type': string; | ||
}; | ||
static requestRedemption({ marketId, amount, denom, address, }: { | ||
static requestRedemption({ marketId, amount, denom, injectiveAddress, }: { | ||
marketId: string; | ||
denom: string; | ||
amount: string; | ||
address: AccountAddress; | ||
injectiveAddress: AccountAddress; | ||
}): { | ||
@@ -17,0 +17,0 @@ '@type': string; |
@@ -11,3 +11,3 @@ "use strict"; | ||
class InsuranceComposer { | ||
static underwrite({ marketId, amount, denom, address, }) { | ||
static underwrite({ marketId, amount, denom, injectiveAddress, }) { | ||
const deposit = new coin_pb_1.Coin(); | ||
@@ -19,6 +19,6 @@ deposit.setAmount(amount); | ||
message.setMarketId(marketId); | ||
message.setSender(address); | ||
message.setSender(injectiveAddress); | ||
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgUnderwrite' }); | ||
} | ||
static requestRedemption({ marketId, amount, denom, address, }) { | ||
static requestRedemption({ marketId, amount, denom, injectiveAddress, }) { | ||
const amountToRedeem = new coin_pb_1.Coin(); | ||
@@ -30,3 +30,3 @@ amountToRedeem.setAmount(amount); | ||
message.setMarketId(marketId); | ||
message.setSender(address); | ||
message.setSender(injectiveAddress); | ||
return Object.assign(Object.assign({}, snakecase_keys_1.default(message.toObject())), { '@type': '/injective.insurance.v1beta1.MsgRequestRedemption' }); | ||
@@ -33,0 +33,0 @@ } |
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { BigNumberInWei } from '@injectivelabs/utils'; | ||
export declare class PeggyComposer { | ||
static withdraw({ address, cosmosAddress, amount, denom, bridgeFeeDenom, bridgeFeeAmount, }: { | ||
static withdraw({ address, injectiveAddress, amount, denom, bridgeFeeDenom, bridgeFeeAmount, }: { | ||
denom: string; | ||
address: AccountAddress; | ||
cosmosAddress: AccountAddress; | ||
amount: BigNumberInWei; | ||
injectiveAddress: AccountAddress; | ||
amount: string; | ||
bridgeFeeDenom?: string; | ||
@@ -10,0 +9,0 @@ bridgeFeeAmount?: string; |
@@ -12,6 +12,6 @@ "use strict"; | ||
class PeggyComposer { | ||
static withdraw({ address, cosmosAddress, amount, denom, bridgeFeeDenom = utils_1.DEFAULT_BRIDGE_FEE_DENOM, bridgeFeeAmount = utils_1.DEFAULT_BRIDGE_FEE_AMOUNT, }) { | ||
static withdraw({ address, injectiveAddress, amount, denom, bridgeFeeDenom = utils_1.DEFAULT_BRIDGE_FEE_DENOM, bridgeFeeAmount = utils_1.DEFAULT_BRIDGE_FEE_AMOUNT, }) { | ||
const coinAmount = new coin_pb_1.Coin(); | ||
coinAmount.setDenom(denom); | ||
coinAmount.setAmount(amount.toFixed()); | ||
coinAmount.setAmount(amount); | ||
const bridgeFee = new coin_pb_1.Coin(); | ||
@@ -22,3 +22,3 @@ bridgeFee.setDenom(bridgeFeeDenom); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setSender(cosmosAddress); | ||
cosmosMessage.setSender(injectiveAddress); | ||
cosmosMessage.setEthDest(address); | ||
@@ -25,0 +25,0 @@ cosmosMessage.setBridgeFee(bridgeFee); |
import { AccountAddress } from '@injectivelabs/ts-types'; | ||
import { BigNumberInWei } from '@injectivelabs/utils'; | ||
export declare class StakingComposer { | ||
static delegate({ cosmosAddress, validatorAddress, amount, denom, }: { | ||
static delegate({ injectiveAddress, validatorAddress, amount, denom, }: { | ||
denom: string; | ||
validatorAddress: string; | ||
cosmosAddress: AccountAddress; | ||
injectiveAddress: AccountAddress; | ||
amount: BigNumberInWei; | ||
}): Record<string, any>; | ||
static reDelegate({ cosmosAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }: { | ||
static reDelegate({ injectiveAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }: { | ||
denom: string; | ||
sourceValidatorAddress: string; | ||
destinationValidatorAddress: string; | ||
cosmosAddress: AccountAddress; | ||
injectiveAddress: AccountAddress; | ||
amount: BigNumberInWei; | ||
}): Record<string, any>; | ||
static unbond({ cosmosAddress, validatorAddress, amount, denom, }: { | ||
static unbond({ injectiveAddress, validatorAddress, amount, denom, }: { | ||
denom: string; | ||
validatorAddress: string; | ||
cosmosAddress: AccountAddress; | ||
injectiveAddress: AccountAddress; | ||
amount: BigNumberInWei; | ||
@@ -22,0 +22,0 @@ }): Record<string, any>; |
@@ -11,3 +11,3 @@ "use strict"; | ||
class StakingComposer { | ||
static delegate({ cosmosAddress, validatorAddress, amount, denom, }) { | ||
static delegate({ injectiveAddress, validatorAddress, amount, denom, }) { | ||
const coinAmount = new coin_pb_1.Coin(); | ||
@@ -18,7 +18,7 @@ coinAmount.setDenom(denom); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setDelegatorAddress(cosmosAddress); | ||
cosmosMessage.setDelegatorAddress(injectiveAddress); | ||
cosmosMessage.setValidatorAddress(validatorAddress); | ||
return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgDelegate' }); | ||
} | ||
static reDelegate({ cosmosAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }) { | ||
static reDelegate({ injectiveAddress, sourceValidatorAddress, destinationValidatorAddress, amount, denom, }) { | ||
const coinAmount = new coin_pb_1.Coin(); | ||
@@ -29,3 +29,3 @@ coinAmount.setDenom(denom); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setDelegatorAddress(cosmosAddress); | ||
cosmosMessage.setDelegatorAddress(injectiveAddress); | ||
cosmosMessage.setValidatorDstAddress(destinationValidatorAddress); | ||
@@ -35,3 +35,3 @@ cosmosMessage.setValidatorSrcAddress(sourceValidatorAddress); | ||
} | ||
static unbond({ cosmosAddress, validatorAddress, amount, denom, }) { | ||
static unbond({ injectiveAddress, validatorAddress, amount, denom, }) { | ||
const coinAmount = new coin_pb_1.Coin(); | ||
@@ -42,3 +42,3 @@ coinAmount.setDenom(denom); | ||
cosmosMessage.setAmount(coinAmount); | ||
cosmosMessage.setDelegatorAddress(cosmosAddress); | ||
cosmosMessage.setDelegatorAddress(injectiveAddress); | ||
cosmosMessage.setValidatorAddress(validatorAddress); | ||
@@ -45,0 +45,0 @@ return Object.assign(Object.assign({}, snakecase_keys_1.default(cosmosMessage.toObject())), { '@type': '/cosmos.staking.v1beta1.MsgUndelegate' }); |
@@ -8,4 +8,4 @@ import { AccountAddress } from '@injectivelabs/ts-types'; | ||
}): Promise<import("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb").DecCoin[]>; | ||
fetchDelegatorRewards(cosmosAddress: AccountAddress): Promise<import("@injectivelabs/chain-api/cosmos/distribution/v1beta1/distribution_pb").DelegationDelegatorReward[]>; | ||
fetchDelegatorRewards(injectiveAddress: AccountAddress): Promise<import("@injectivelabs/chain-api/cosmos/distribution/v1beta1/distribution_pb").DelegationDelegatorReward[]>; | ||
} | ||
//# sourceMappingURL=DistributionConsumer.d.ts.map |
@@ -35,6 +35,6 @@ "use strict"; | ||
} | ||
fetchDelegatorRewards(cosmosAddress) { | ||
fetchDelegatorRewards(injectiveAddress) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const request = new query_pb_1.QueryDelegationTotalRewardsRequest(); | ||
request.setDelegatorAddress(cosmosAddress); | ||
request.setDelegatorAddress(injectiveAddress); | ||
try { | ||
@@ -41,0 +41,0 @@ const response = yield this.request(request, query_pb_service_1.Query.DelegationTotalRewards); |
@@ -8,4 +8,4 @@ import BaseConsumer from '../BaseConsumer'; | ||
}>; | ||
fetchDelegations({ cosmosAddress, pagination, }: { | ||
cosmosAddress: string; | ||
fetchDelegations({ injectiveAddress, pagination, }: { | ||
injectiveAddress: string; | ||
pagination?: PaginationOption; | ||
@@ -23,4 +23,4 @@ }): Promise<{ | ||
}>; | ||
fetchUnbondingDelegations({ cosmosAddress, pagination, }: { | ||
cosmosAddress: string; | ||
fetchUnbondingDelegations({ injectiveAddress, pagination, }: { | ||
injectiveAddress: string; | ||
pagination?: PaginationOption; | ||
@@ -31,4 +31,4 @@ }): Promise<{ | ||
}>; | ||
fetchReDelegations({ cosmosAddress, pagination, }: { | ||
cosmosAddress: string; | ||
fetchReDelegations({ injectiveAddress, pagination, }: { | ||
injectiveAddress: string; | ||
pagination?: PaginationOption; | ||
@@ -35,0 +35,0 @@ }): Promise<{ |
@@ -37,6 +37,6 @@ "use strict"; | ||
} | ||
fetchDelegations({ cosmosAddress, pagination, }) { | ||
fetchDelegations({ injectiveAddress, pagination, }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const request = new query_pb_1.QueryDelegatorDelegationsRequest(); | ||
request.setDelegatorAddr(cosmosAddress); | ||
request.setDelegatorAddr(injectiveAddress); | ||
if (pagination) { | ||
@@ -80,6 +80,6 @@ const paginationForRequest = new pagination_pb_1.PageRequest(); | ||
} | ||
fetchUnbondingDelegations({ cosmosAddress, pagination, }) { | ||
fetchUnbondingDelegations({ injectiveAddress, pagination, }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const request = new query_pb_1.QueryDelegatorUnbondingDelegationsRequest(); | ||
request.setDelegatorAddr(cosmosAddress); | ||
request.setDelegatorAddr(injectiveAddress); | ||
if (pagination) { | ||
@@ -102,6 +102,6 @@ const paginationForRequest = new pagination_pb_1.PageRequest(); | ||
} | ||
fetchReDelegations({ cosmosAddress, pagination, }) { | ||
fetchReDelegations({ injectiveAddress, pagination, }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const request = new query_pb_1.QueryRedelegationsRequest(); | ||
request.setDelegatorAddr(cosmosAddress); | ||
request.setDelegatorAddr(injectiveAddress); | ||
if (pagination) { | ||
@@ -108,0 +108,0 @@ const paginationForRequest = new pagination_pb_1.PageRequest(); |
{ | ||
"name": "@injectivelabs/chain-consumer", | ||
"description": "Interacting with our Chain API made easy. Can be reused throughout Injective's projects.", | ||
"version": "0.0.66", | ||
"version": "0.0.67", | ||
"license": "MIT", | ||
@@ -42,3 +42,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "279b4318d05e88040fcc66188ba616e584b8efcd" | ||
"gitHead": "5c2c8109d3681367bebbf10b32cbaec0e719855d" | ||
} |
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
130686
0.28%1288
-0.08%