@injectivelabs/chain-consumer
Advanced tools
Comparing version 0.0.98 to 0.0.99
@@ -1,2 +0,2 @@ | ||
import { QueryCurrentAuctionBasketResponse } from '@injectivelabs/chain-api/injective/auction/v1beta1/query_pb'; | ||
import { QueryModuleStateResponse, QueryCurrentAuctionBasketResponse } from '@injectivelabs/chain-api/injective/auction/v1beta1/query_pb'; | ||
import { GrpcAuctionParams } from '../types'; | ||
@@ -6,5 +6,5 @@ import BaseConsumer from '../BaseConsumer'; | ||
fetchParams(): Promise<GrpcAuctionParams>; | ||
fetchModuleState(): Promise<import("@injectivelabs/chain-api/injective/auction/v1beta1/genesis_pb").GenesisState | undefined>; | ||
fetchModuleState(): Promise<QueryModuleStateResponse>; | ||
fetchCurrentBasket(): Promise<QueryCurrentAuctionBasketResponse>; | ||
} | ||
//# sourceMappingURL=AuctionConsumer.d.ts.map |
@@ -37,4 +37,3 @@ "use strict"; | ||
try { | ||
const response = yield this.request(request, query_pb_service_1.Query.AuctionModuleState); | ||
return response.getState(); | ||
return yield this.request(request, query_pb_service_1.Query.AuctionModuleState); | ||
} | ||
@@ -41,0 +40,0 @@ catch (e) { |
@@ -11,4 +11,4 @@ import { QueryCurrentAuctionBasketResponse, QueryModuleStateResponse } from '@injectivelabs/chain-api/injective/auction/v1beta1/query_pb'; | ||
static grpcCurrentBasketToCurrentBasket(basket: QueryCurrentAuctionBasketResponse): CurrentBasket; | ||
static grpcAuctionModuleStateToAuctionModuleState(auctionModuleState: QueryModuleStateResponse.AsObject): AuctionModuleState; | ||
static grpcAuctionModuleStateToAuctionModuleState(auctionModuleState: QueryModuleStateResponse): AuctionModuleState; | ||
} | ||
//# sourceMappingURL=ExchangeTransformer.d.ts.map |
@@ -72,7 +72,21 @@ "use strict"; | ||
static grpcAuctionModuleStateToAuctionModuleState(auctionModuleState) { | ||
const state = auctionModuleState.getState(); | ||
const bid = state.getHighestBid(); | ||
const params = state.getParams(); | ||
return { | ||
params: auctionModuleState.state.params, | ||
auctionRound: auctionModuleState.state.auctionRound, | ||
highestBid: auctionModuleState.state.highestBid, | ||
auctionEndingTimestamp: auctionModuleState.state.auctionEndingTimestamp, | ||
params: { | ||
auctionPeriod: params.getAuctionPeriod(), | ||
minNextBidIncrementRate: params.getMinNextBidIncrementRate(), | ||
}, | ||
auctionRound: state.getAuctionRound(), | ||
highestBid: bid | ||
? { | ||
bidder: bid.getBidder(), | ||
amount: bid.getAmount(), | ||
} | ||
: { | ||
amount: '', | ||
bidder: '', | ||
}, | ||
auctionEndingTimestamp: state.getAuctionEndingTimestamp(), | ||
}; | ||
@@ -79,0 +93,0 @@ } |
@@ -13,2 +13,3 @@ 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 { Coin } from '@injectivelabs/ts-types'; | ||
import { QueryCurrentAuctionBasketResponse as GrpcQueryCurrentAuctionBasketResponse } from '@injectivelabs/chain-api/injective/auction/v1beta1/query_pb'; | ||
export interface PaginationOption { | ||
@@ -58,2 +59,4 @@ key: string; | ||
} | ||
export interface GrpcCurrentBasket extends GrpcQueryCurrentAuctionBasketResponse.AsObject { | ||
} | ||
export interface CurrentBasket { | ||
@@ -60,0 +63,0 @@ amountList: Coin[]; |
{ | ||
"name": "@injectivelabs/chain-consumer", | ||
"description": "Interacting with our Chain API made easy. Can be reused throughout Injective's projects.", | ||
"version": "0.0.98", | ||
"version": "0.0.99", | ||
"license": "MIT", | ||
@@ -42,3 +42,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "52010f4e52a0b27fc084816cddd365be1801c44f" | ||
"gitHead": "a1df8e63d2b6d105e7cdc1f4be7c6442cb627639" | ||
} |
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
217215
2714