Skip to content

Commit

Permalink
chore: package bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRalee committed Oct 12, 2023
1 parent 502f18e commit 4630cf9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
"@injectivelabs/indexer-proto-ts": "1.11.10",
"@injectivelabs/mito-proto-ts": "1.0.46",
"@injectivelabs/mito-proto-ts": "1.0.47",
"@injectivelabs/networks": "^1.14.1-beta.1",
"@injectivelabs/test-utils": "^1.14.1-beta.0",
"@injectivelabs/token-metadata": "^1.14.1-beta.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ describe('IndexerGrpcMitoApi', () => {

test('fetchHolderPortfolio', async () => {
try {
const response = await indexerGrpcMitoApi.fetchHolderPortfolio(
injectiveAddress,
)
const response = await indexerGrpcMitoApi.fetchHolderPortfolio({
stakingContractAddress,
holderAddress: injectiveAddress,
})

if (!response) {
console.warn('fetchHolderPortfolio.portfolioNotFound')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,17 @@ export class IndexerGrpcMitoApi extends BaseGrpcConsumer {
}
}

async fetchHolderPortfolio(holderAddress: string) {
async fetchHolderPortfolio({
holderAddress,
stakingContractAddress,
}: {
holderAddress: string
stakingContractAddress: string
}) {
const request = MitoApi.PortfolioRequest.create()

request.holderAddress = holderAddress
request.stakingContractAddress = stakingContractAddress

try {
const response = await this.retry<MitoApi.PortfolioResponse>(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export class IndexerGrpcMitoTransformer {
pnlChartList: portfolio.pnlChart.map(
IndexerGrpcMitoTransformer.mitoPriceSnapshotToPriceSnapshot,
),
updatedAt: parseInt(portfolio.pnlUpdatedAt, 10),
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/sdk-ts/src/client/indexer/types/mito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface MitoPortfolio {
pnl: number
totalValueChartList: MitoPriceSnapshot[]
pnlChartList: MitoPriceSnapshot[]
updatedAt: number
}

export interface MitoLeaderboardEntry {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2176,10 +2176,10 @@
protobufjs "^7.0.0"
rxjs "^7.4.0"

"@injectivelabs/[email protected].46":
version "1.0.46"
resolved "https://registry.yarnpkg.com/@injectivelabs/mito-proto-ts/-/mito-proto-ts-1.0.46.tgz#d0e31c4ca2f76940771621b2fe88f9bc40c7a891"
integrity sha512-K1g5udssQd4pDNzMteUQiI3PLHsuBhCKT6wli2h05ImB0NFQcGbLQlk3lpzsdfE9Usx2hCmZiQNUfUouRrTBpQ==
"@injectivelabs/[email protected].47":
version "1.0.47"
resolved "https://registry.yarnpkg.com/@injectivelabs/mito-proto-ts/-/mito-proto-ts-1.0.47.tgz#bcc53839a7204530a3d585772b42aa6c3d14cd9e"
integrity sha512-MJpxbvxUImjmowqB4Ny5BY7vv2x8lU5+cgchTzhT71jaLWTPL4VzjSjUPA1M/MHopaTemEZqDKOOmbRJwA5OZg==
dependencies:
"@injectivelabs/grpc-web" "^0.0.1"
google-protobuf "^3.14.0"
Expand Down

0 comments on commit 4630cf9

Please sign in to comment.