-
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.
Restore sorting feature on All Pools page (#1679)
* Make makeQueryKey2, pull keys to shareable structure * Update hooks to use new makeQueryKey2 * Move getDepositAssets to own file * Refactor to destructured object params * Move logic out to own function for re-use in other hooks * Use fiat price from hook * Refactor PoolsList fetching to own hook, bring back Sort button * Add comments * Fix sorting by variable rate * Remove dead code
- Loading branch information
1 parent
c3380b3
commit 00d19a5
Showing
25 changed files
with
940 additions
and
499 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
33 changes: 33 additions & 0 deletions
33
apps/hyperdrive-trading/src/hyperdrive/getDepositAssets.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,33 @@ | ||
import { ZERO_ADDRESS } from "@delvtech/drift"; | ||
import { | ||
HyperdriveConfig, | ||
TokenConfig, | ||
appConfig, | ||
getBaseToken, | ||
getToken, | ||
} from "@delvtech/hyperdrive-appconfig"; | ||
|
||
// TODO: Move this to the appconfig | ||
export function getDepositAssets(hyperdrive: HyperdriveConfig): TokenConfig[] { | ||
const depositAssets: TokenConfig[] = []; | ||
if (hyperdrive.depositOptions.isBaseTokenDepositEnabled) { | ||
const baseToken = getBaseToken({ | ||
hyperdriveChainId: hyperdrive.chainId, | ||
hyperdriveAddress: hyperdrive.address, | ||
appConfig, | ||
}); | ||
depositAssets.push(baseToken); | ||
} | ||
|
||
if (hyperdrive.depositOptions.isShareTokenDepositsEnabled) { | ||
const sharesToken = getToken({ | ||
chainId: hyperdrive.chainId, | ||
tokenAddress: hyperdrive.poolConfig.vaultSharesToken, | ||
appConfig, | ||
}); | ||
if (sharesToken && sharesToken.address !== ZERO_ADDRESS) { | ||
depositAssets.push(sharesToken); | ||
} | ||
} | ||
return depositAssets; | ||
} |
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
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
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.