-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[new apy]: rename getSnapshots, PR improves
- Loading branch information
Showing
18 changed files
with
103 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export { fetchSnapshotsQuery } from './snapshotsQuery.graphql' | ||
export type { SnapshotsQueryPayload, SnapshotsQueryVariables } from './snapshotsQuery.graphql' | ||
|
||
export { fetchValidatorsQuery } from './validatorsQuery.graphql' | ||
export type { ValidatorsQueryPayload, ValidatorsQueryVariables } from './validatorsQuery.graphql' | ||
|
||
export { fetchUserRewardsQuery } from './userRewardsQuery.graphql' | ||
export type { UserRewardsQueryPayload, UserRewardsQueryVariables } from './userRewardsQuery.graphql' | ||
|
||
export { fetchVaultSnapshotsQuery } from './vaultSnapshotsQuery.graphql' | ||
export type { VaultSnapshotsQueryPayload, VaultSnapshotsQueryVariables } from './vaultSnapshotsQuery.graphql' |
6 changes: 3 additions & 3 deletions
6
...backend/vault/vaultSnapshotsQuery.graphql → ...phql/backend/vault/snapshotsQuery.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
query VaultSnapshots($vaultAddress: String! $dateFrom: DateAsTimestamp! $dateTo: DateAsTimestamp $first: Int) { | ||
query Snapshots($vaultAddress: String! $dateFrom: DateAsTimestamp! $dateTo: DateAsTimestamp $first: Int) { | ||
vaultSnapshots( | ||
vaultAddress: $vaultAddress | ||
dateFrom: $dateFrom | ||
dateTo: $dateTo | ||
first: $first | ||
) { | ||
date, | ||
rewardPerAsset: weeklyApy | ||
weeklyApy | ||
totalAssets | ||
} | ||
firstSnapshots: vaultSnapshots(vaultAddress: $vaultAddress, dateFrom: $dateFrom, first: 1) { | ||
date | ||
totalAssets | ||
rewardPerAsset: weeklyApy | ||
weeklyApy | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
src/graphql/subgraph/daySnapshots/daySnapshotsQuery.graphql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export * as vault from './vault' | ||
export * as osToken from './osToken' | ||
export * as exitQueue from './exitQueue' | ||
export * as daySnapshots from './daySnapshots' | ||
export * as transactions from './transactions' | ||
export * as allocatorActions from './allocatorActions' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
61 changes: 0 additions & 61 deletions
61
src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.spec.ts
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { SnapshotsQueryVariables } from '../../../../graphql/backend/vault' | ||
import { apiUrls, validateArgs } from '../../../../utils' | ||
import modifySnapshots from './modifySnapshots' | ||
import graphql from '../../../../graphql' | ||
import { ModifiedSnapshots } from './types' | ||
|
||
|
||
type GetSnapshotsInput = { | ||
options: StakeWise.Options | ||
vaultAddress: SnapshotsQueryVariables['vaultAddress'] | ||
dateFrom: SnapshotsQueryVariables['dateFrom'] | ||
} | ||
|
||
const getSnapshots = async (input: GetSnapshotsInput) => { | ||
const { options, vaultAddress, dateFrom } = input | ||
|
||
validateArgs.address({ vaultAddress }) | ||
validateArgs.string({ dateFrom }) | ||
|
||
const data = await graphql.backend.vault.fetchSnapshotsQuery<ModifiedSnapshots>({ | ||
url: apiUrls.getBackendUrl(options), | ||
variables: { | ||
vaultAddress: vaultAddress.toLowerCase(), | ||
dateFrom, | ||
} as SnapshotsQueryVariables, | ||
modifyResult: modifySnapshots, | ||
}) | ||
|
||
return data | ||
} | ||
|
||
|
||
export default getSnapshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.