Skip to content

Commit

Permalink
chore: pacakge bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRalee committed Dec 9, 2023
1 parent 13689f7 commit f3d88ef
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Coin } from '@injectivelabs/ts-types'
import { InjectiveCampaignRpc } from '@injectivelabs/indexer-proto-ts'
import { grpcPagingToPaging } from '../../..//utils/pagination'
import {
Expand All @@ -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 {
Expand All @@ -20,6 +29,8 @@ export class IndexerCampaignTransformer {
contractUpdated: campaignUser.contractUpdated,
blockHeight: campaignUser.blockHeight,
blockTime: parseInt(campaignUser.blockTime, 10),
purchasedAmount: campaignUser.purchasedAmount,
galxeUpdated: campaignUser.galxeUpdated,
}
}

Expand Down Expand Up @@ -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,
),
}
}

Expand Down
5 changes: 5 additions & 0 deletions packages/sdk-ts/src/client/indexer/types/campaign.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Coin } from '@injectivelabs/ts-types'
import { InjectiveCampaignRpc } from '@injectivelabs/indexer-proto-ts'

export interface Campaign {
Expand All @@ -18,6 +19,8 @@ export interface CampaignUser {
contractUpdated: boolean
blockHeight: string
blockTime: number
purchasedAmount: string
galxeUpdated: boolean
}

export interface Guild {
Expand Down Expand Up @@ -48,6 +51,8 @@ export interface GuildMember {
totalTvl: string
volumeScorePercentage: number
tvlScorePercentage: number
tvlReward: Coin[]
volumeReward: Coin[]
}

export interface GuildCampaignSummary {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2081,10 +2081,10 @@
dependencies:
browser-headers "^0.4.1"

"@injectivelabs/[email protected].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/[email protected].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"
Expand Down

0 comments on commit f3d88ef

Please sign in to comment.