-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): extract denom constants to a dedicated config
- Loading branch information
1 parent
dbc6830
commit 5f9af54
Showing
4 changed files
with
13 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { MainnetNetworkId, SandboxNetworkId } from "@akashnetwork/akashjs/build/types/network"; | ||
import { MAINNET_ID, SANDBOX_ID } from "@akashnetwork/network-store"; | ||
|
||
export const UAKT_DENOM = "uakt"; | ||
export const USDC_IBC_DENOMS: Record<MainnetNetworkId | SandboxNetworkId, string> = { | ||
[MAINNET_ID]: "ibc/170C677610AC31DF0904FFE09CD3B5C657492170E7E52372E48756B71E56F2F1", | ||
[SANDBOX_ID]: "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84" | ||
}; |
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,22 +1,8 @@ | ||
import { getSelectedNetwork, useSelectedNetwork } from "./useSelectedNetwork"; | ||
import { useSelectedNetwork } from "./useSelectedNetwork"; | ||
|
||
import { usdcIbcDenoms } from "@/lib/constants"; | ||
import { USDC_IBC_DENOMS } from "@/config/denom.config"; | ||
|
||
export const useUsdcDenom = () => { | ||
const selectedNetwork = useSelectedNetwork(); | ||
return usdcIbcDenoms[selectedNetwork.id]; | ||
}; | ||
|
||
export const getUsdcDenom = () => { | ||
const selectedNetwork = getSelectedNetwork(); | ||
return usdcIbcDenoms[selectedNetwork.id as any]; | ||
}; | ||
|
||
export const useSdlDenoms = () => { | ||
const usdcDenom = useUsdcDenom(); | ||
|
||
return [ | ||
{ id: "uakt", label: "uAKT", tokenLabel: "AKT", value: "uakt" }, | ||
{ id: "uusdc", label: "uUSDC", tokenLabel: "USDC", value: usdcDenom } | ||
]; | ||
return USDC_IBC_DENOMS[selectedNetwork.id]; | ||
}; |
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