diff --git a/packages/sdk-ts/package.json b/packages/sdk-ts/package.json index dff0a267f..3c83c6e86 100644 --- a/packages/sdk-ts/package.json +++ b/packages/sdk-ts/package.json @@ -44,7 +44,7 @@ "@injectivelabs/grpc-web": "^0.0.1", "@injectivelabs/grpc-web-node-http-transport": "^0.0.2", "@injectivelabs/grpc-web-react-native-transport": "^0.0.2", - "@injectivelabs/indexer-proto-ts": "1.11.23", + "@injectivelabs/indexer-proto-ts": "1.11.24", "@injectivelabs/mito-proto-ts": "1.0.55", "@injectivelabs/networks": "^1.14.5-beta.1", "@injectivelabs/test-utils": "^1.14.3", diff --git a/packages/sdk-ts/src/client/indexer/transformers/IndexerCampaignTransformer.ts b/packages/sdk-ts/src/client/indexer/transformers/IndexerCampaignTransformer.ts index 2205b7e09..f6dc45262 100644 --- a/packages/sdk-ts/src/client/indexer/transformers/IndexerCampaignTransformer.ts +++ b/packages/sdk-ts/src/client/indexer/transformers/IndexerCampaignTransformer.ts @@ -1,3 +1,4 @@ +import { Coin } from '@injectivelabs/ts-types' import { InjectiveCampaignRpc } from '@injectivelabs/indexer-proto-ts' import { grpcPagingToPaging } from '../../..//utils/pagination' import { @@ -7,8 +8,16 @@ import { CampaignUser, GuildCampaignSummary, } from '../types/campaign' +import { GrpcCoin } from '../../../types' export class IndexerCampaignTransformer { + static GrpcCoinToCoin(coin: GrpcCoin): Coin { + return { + denom: coin.denom, + amount: coin.amount, + } + } + static GrpcCampaignUserToCampaignUser( campaignUser: InjectiveCampaignRpc.CampaignUser, ): CampaignUser { @@ -20,6 +29,8 @@ export class IndexerCampaignTransformer { contractUpdated: campaignUser.contractUpdated, blockHeight: campaignUser.blockHeight, blockTime: parseInt(campaignUser.blockTime, 10), + purchasedAmount: campaignUser.purchasedAmount, + galxeUpdated: campaignUser.galxeUpdated, } } @@ -70,6 +81,12 @@ export class IndexerCampaignTransformer { totalTvl: member.totalTvl, volumeScorePercentage: member.volumeScorePercentage, tvlScorePercentage: member.tvlScorePercentage, + tvlReward: member.tvlReward.map( + IndexerCampaignTransformer.GrpcCoinToCoin, + ), + volumeReward: member.volumeReward.map( + IndexerCampaignTransformer.GrpcCoinToCoin, + ), } } diff --git a/packages/sdk-ts/src/client/indexer/types/campaign.ts b/packages/sdk-ts/src/client/indexer/types/campaign.ts index da040e292..488e0c734 100644 --- a/packages/sdk-ts/src/client/indexer/types/campaign.ts +++ b/packages/sdk-ts/src/client/indexer/types/campaign.ts @@ -1,3 +1,4 @@ +import { Coin } from '@injectivelabs/ts-types' import { InjectiveCampaignRpc } from '@injectivelabs/indexer-proto-ts' export interface Campaign { @@ -18,6 +19,8 @@ export interface CampaignUser { contractUpdated: boolean blockHeight: string blockTime: number + purchasedAmount: string + galxeUpdated: boolean } export interface Guild { @@ -48,6 +51,8 @@ export interface GuildMember { totalTvl: string volumeScorePercentage: number tvlScorePercentage: number + tvlReward: Coin[] + volumeReward: Coin[] } export interface GuildCampaignSummary { diff --git a/yarn.lock b/yarn.lock index e5256c568..6e1c3471b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2081,10 +2081,10 @@ dependencies: browser-headers "^0.4.1" -"@injectivelabs/indexer-proto-ts@1.11.23": - version "1.11.23" - resolved "https://registry.yarnpkg.com/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.11.23.tgz#a27948be06a81cf63efcee830398ed96cce393ef" - integrity sha512-HrgaVpfovyUg7eFPZuPWUBxP9+tBgGGNZJtHMGb3IISTCkG2MqAwmu6LAiDy206rRksJJJBu0UtLzWPANRVabQ== +"@injectivelabs/indexer-proto-ts@1.11.24": + version "1.11.24" + resolved "https://registry.yarnpkg.com/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.11.24.tgz#29ab84eacef3f6f5d2ed3c6e8b53480930f34189" + integrity sha512-2nL2gdnb0DYZvza2tBJ2ENrhNQ3UM3IPDgVRZri+WOJKpWVb/Y4FBLA5K/kwm7Co3WpeCcJrtyXuEQzYmhxiWw== dependencies: "@injectivelabs/grpc-web" "^0.0.1" google-protobuf "^3.14.0"