-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
rewards
field to top-level appconfig (#1701)
* Refactor chainlog to makeQueryKey2 * Add rewards field to appconfig, DRY up some references * Move to own file * Add rewardsMap parsing to getHyperdriveConfig functions * overly wordy * Remove stray log
- Loading branch information
1 parent
5614d76
commit 5180d5e
Showing
19 changed files
with
830 additions
and
555 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
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,16 @@ | ||
import "src/base/makeQueryKey"; | ||
|
||
interface ChainlogQueryKeys { | ||
pools: { | ||
chainIds: number[]; | ||
}; | ||
factories: { | ||
chainIds: number[]; | ||
}; | ||
} | ||
|
||
declare module "src/base/makeQueryKey" { | ||
interface QueryKeys { | ||
chainlog: ChainlogQueryKeys; | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
packages/hyperdrive-appconfig/src/appconfig/HyperdriveConfigResolver.ts
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,24 @@ | ||
import { ReadHyperdrive } from "@delvtech/hyperdrive-viem"; | ||
import { HyperdriveConfig } from "src/hyperdrives/HyperdriveConfig"; | ||
import { AnyRewardKey } from "src/hyperdrives/rewards"; | ||
import { RewardResolverKey } from "src/rewards/rewards"; | ||
import { TokenConfig } from "src/tokens/types"; | ||
import { PublicClient } from "viem"; | ||
|
||
export interface HyperdriveConfigResolverResult { | ||
hyperdriveConfig: HyperdriveConfig; | ||
sharesTokenConfig?: TokenConfig; | ||
baseTokenConfig?: TokenConfig; | ||
rewards?: Record<AnyRewardKey, RewardResolverKey[]>; | ||
} | ||
|
||
export type HyperdriveConfigResolver = ( | ||
hyperdrive: ReadHyperdrive, | ||
publicClient: PublicClient, | ||
/** | ||
* Block number to clamp the beginning of event requests to. This is useful | ||
* for L2s that have too many blocks where the default "earliest" blockTag | ||
* would timeout. | ||
*/ | ||
earliestBlock?: bigint, | ||
) => Promise<HyperdriveConfigResolverResult>; |
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.