Skip to content
Open
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
1ebf537
branch evm native chain info from ModularChainInfo
editaahn Sep 19, 2025
d6b381b
add Union for EthermintLike / rename `evmNative` to `evm`
editaahn Sep 28, 2025
bad841d
Merge pull request #1590 from chainapsis/editaahn/refactor-modular/ba…
editaahn Oct 27, 2025
45f2b3e
add condition for evm chains when displaying swap tab
editaahn Sep 28, 2025
0d54c9e
add conditions for evm custom tokens
editaahn Sep 28, 2025
b11caea
add conditions for listing evm balances
editaahn Sep 29, 2025
51d09de
fix to display erc token currencies
editaahn Oct 10, 2025
01382f8
use `modularChainInfoImpl.getCurrencies("evm")` in updateBalances
editaahn Oct 13, 2025
d1558b9
normalize currency denoms while fetching balance
editaahn Oct 13, 2025
c42d957
merge repo's currencies to modualr chain infos
editaahn Oct 13, 2025
097d9f2
hide assets without balance
editaahn Oct 13, 2025
3f19011
fix: show custom token balances
editaahn Oct 13, 2025
2cb8c63
branch evm<>cosmos in TokenDetail
editaahn Oct 14, 2025
b3e40e2
branch evm<>cosmos in CopyAddress
editaahn Oct 14, 2025
4267643
modularChainInfos for suggest chains
editaahn Oct 14, 2025
78f1dd8
update refresh button logic for evm chains
editaahn Oct 14, 2025
3f63317
update QR code condition in ReceiveModal
editaahn Oct 15, 2025
5cf83c7
update KeyRing's coinType branching
editaahn Oct 15, 2025
73df350
update detail functionalities
editaahn Oct 15, 2025
fea02fe
add methods to `ModularChainInfoImpl` for replacing ChainInfoImpl
editaahn Oct 19, 2025
d650229
update forceFindCurrency, findCurrency not to require `module` arg
editaahn Oct 20, 2025
6a3fa58
provide `hasFeature`
editaahn Oct 22, 2025
0c3bc4e
rename `getCurrencies` to `getCurrenciesByModule` / add new `getCurre…
editaahn Oct 22, 2025
457e14f
add `feeCurrencies` to EVMNativeChainInfo
editaahn Oct 22, 2025
1529d2e
use forceFindCurrency
editaahn Oct 22, 2025
d16ae81
provide `findCurrencyAsync` and replace
editaahn Oct 24, 2025
58ad1a2
provide stakeCurrency, feeCurrencies from ModularChainInfoImpl
editaahn Oct 24, 2025
bb5db35
replace chainStore.getChain with chainStore.getModularChain
editaahn Oct 22, 2025
57fe152
replace all chainStore.hasChain to hasModularChain
editaahn Oct 24, 2025
825cb87
update balance logics to use modularChainInfo
editaahn Oct 23, 2025
c9e1bb0
replace chainStore.getChain with chainStore.getModularChain / getModu…
editaahn Oct 24, 2025
d4b9b3f
replace chainStore methods and following logics
editaahn Oct 27, 2025
2e01da2
add @action decorator to updateTokenMap
editaahn Oct 28, 2025
b417da5
remove `registerTokenToModularChain` since the logic is duplicated to…
editaahn Oct 28, 2025
6f66e02
prevent duplicated token display in Add/Remove Chains
editaahn Oct 28, 2025
429db8b
udpate search field conditions
editaahn Oct 28, 2025
93cc0bf
update methods finding currency
editaahn Oct 28, 2025
d45cbd6
fix runtime error
editaahn Oct 28, 2025
0a2daa5
resolve missing parts & error / replace `hasModularChainInfo` with `m…
editaahn Oct 29, 2025
95fe055
resolve mssing parts & errors
editaahn Oct 31, 2025
8399235
fix conditions and housekeep
editaahn Nov 3, 2025
7cc273e
replace methods with `getModularChainInfoOrThrow`, `isEthermintLike`
editaahn Nov 3, 2025
0568cd9
Merge pull request #1606 from chainapsis/editaahn/refactor-modular/br…
editaahn Nov 3, 2025
c6f7d58
address Ledger cases
editaahn Nov 4, 2025
163afb5
Merge pull request #1607 from chainapsis/editaahn/refactor-modular/le…
editaahn Nov 4, 2025
ad04416
convert ChaniInfo types to ModularChainInfo in `LookingForChain` func…
editaahn Nov 5, 2025
498a3dc
update isEvmOrEthermintLikeChain condition
editaahn Nov 5, 2025
f65ffa0
rename variables / clear console messages and annotations
editaahn Nov 5, 2025
c091f33
fix condition mistake
editaahn Nov 6, 2025
427c588
add and utilize `isNative`
editaahn Nov 7, 2025
9088d3b
Merge pull request #1619 from chainapsis/editaahn/refactor-modular/le…
editaahn Nov 10, 2025
3cc1937
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-…
editaahn Nov 10, 2025
2918dbb
fix type errors
editaahn Nov 10, 2025
f194512
변경 누락분 추가 수정
editaahn Nov 11, 2025
e520422
yarn.lock file automatic change
editaahn Nov 11, 2025
dbdf784
Resolve merge conflicts in hooks-internal/package.json and yarn.lock
editaahn Nov 11, 2025
6664ecc
fix missing branching logics / organize code
editaahn Nov 14, 2025
02ab96d
fix missing branching logics / organize code
editaahn Nov 18, 2025
b4f06fc
replace chainStore.chainInfos with chainStore.modularChainInfos
editaahn Nov 19, 2025
6f010f7
fix bug where LookingForChain displaying Bitcoin chains twice
editaahn Nov 25, 2025
27b0d8b
replace rest chainStore.chainInfosInUI with modularChainInfosInUI
editaahn Nov 26, 2025
9414a3d
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-…
editaahn Nov 26, 2025
4607193
adjust for ModularChainInfo conversion after Supernova update
editaahn Nov 27, 2025
186cded
deprecate old chain info accessors and methods in ChainStore
editaahn Nov 27, 2025
741baef
code improvement
editaahn Dec 1, 2025
078d35c
code improvement
editaahn Dec 3, 2025
16d6d9f
key finalization and chain enabling logic to include EVM chains
editaahn Dec 3, 2025
f9bdcb3
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-…
editaahn Dec 3, 2025
12029f3
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-…
editaahn Dec 4, 2025
d369ff5
remove console.log
editaahn Dec 4, 2025
bbe32fd
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-…
editaahn Dec 5, 2025
8381489
v0.12.300-rc.0
Thunnini Dec 5, 2025
4c811a0
fix condition in enable button onClick
editaahn Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/extension/src/analytics-amplitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ export const logNobleClaimAnalytics = async (
eventName: string
) => {
const chainId = NOBLE_CHAIN_ID;
const chainInfo = chainStore.getChain(chainId);
const currency = await chainInfo.findCurrencyAsync("uusdn");
const chainInfo = chainStore.getModularChain(chainId);
const currency = await chainStore
.getModularChainInfoImpl(chainId)
.findCurrencyAsync("uusdn");
const bech32Address = accountStore.getAccount(chainId).bech32Address;

if (!bech32Address) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ export const AddressBookModal: FunctionComponent<{
debounceTrimmedSearchText,
]);

const chainInfo = chainStore.getChain(recipientConfig.chainId);
const chainInfo = chainStore.getModularChainInfoImpl(
recipientConfig.chainId
);
const isEVMChain = chainStore.isEvmChain(chainInfo.chainId);
const isEVMOnlyChain = chainStore.isEvmOnlyChain(chainInfo.chainId);
const isERC20 = new DenomHelper(currency.coinMinimalDenom).type === "erc20";
Expand Down
11 changes: 7 additions & 4 deletions apps/extension/src/components/image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export const CurrencyImageFallback: FunctionComponent<
currency.originCurrency
) {
if (
chainStore.hasChain(currency.originChainId) &&
chainStore.getChain(currency.originChainId).chainIdentifier ===
chainStore.hasModularChain(currency.originChainId) &&
ChainIdHelper.parse(currency.originChainId).identifier ===
axelarChainIdentifier &&
currency.originCurrency.coinMinimalDenom !== "uaxl"
) {
Expand All @@ -176,9 +176,12 @@ export const CurrencyImageFallback: FunctionComponent<
}
}

if (isAxelarBridged && chainStore.hasChain(axelarChainIdentifier)) {
if (
isAxelarBridged &&
chainStore.hasModularChain(axelarChainIdentifier)
) {
const axlCurrency = chainStore
.getChain(axelarChainIdentifier)
.getModularChainInfoImpl(axelarChainIdentifier)
.findCurrency("uaxl");

if (axlCurrency && axlCurrency.coinImageUrl) {
Expand Down
4 changes: 2 additions & 2 deletions apps/extension/src/components/input/amount-input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ export const AmountInput: FunctionComponent<{
// However, in this case, the tax itself changes the fee,
// so if you use the max function, it will fall into infinite repetition.
// We currently disable if chain is terra classic because we can't handle it properly.
chainStore.hasChain(amountConfig.chainId) &&
chainStore.hasModularChain(amountConfig.chainId) &&
chainStore
.getChain(amountConfig.chainId)
.getModularChainInfoImpl(amountConfig.chainId)
.hasFeature("terra-classic-fee")
) {
return undefined;
Expand Down
15 changes: 10 additions & 5 deletions apps/extension/src/components/input/fee-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const useAutoFeeCurrencySelectionOnInit = (
feeConfig.fees.length > 0
) {
const queryBalances =
chainStore.getChain(feeConfig.chainId).evm != null &&
"evm" in chainStore.getModularChain(feeConfig.chainId) &&
EthereumAccountBase.isEthereumHexAddressWithChecksum(
senderConfig.sender
)
Expand All @@ -122,9 +122,12 @@ export const useAutoFeeCurrencySelectionOnInit = (
feeConfig.type
);
if (currentFeeCurrencyBal.toDec().lt(currentFee.toDec())) {
const modularChainInfoImpl = chainStore.getModularChainInfoImpl(
feeConfig.chainId
);
const isOsmosis =
chainStore.hasChain(feeConfig.chainId) &&
chainStore.getChain(feeConfig.chainId).hasFeature("osmosis-txfees");
modularChainInfoImpl.matchModule("cosmos") &&
modularChainInfoImpl.hasFeature("osmosis-txfees");

// Not enough balances for fee.
// Try to find other fee currency to send.
Expand Down Expand Up @@ -291,12 +294,14 @@ export const FeeControl: FunctionComponent<{
if (feeConfig.fees.length > 0) {
return feeConfig.fees;
}
const chainInfo = chainStore.getChain(
const chainInfo = chainStore.getModularChainInfoImpl(
feeConfig.chainId
);
return [
new CoinPretty(
chainInfo.stakeCurrency || chainInfo.currencies[0],
("cosmos" in chainInfo.embedded &&
chainInfo.embedded.cosmos.stakeCurrency) ||
chainInfo.getCurrencies()[0],
new Dec(0)
),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ export const RecipientInput = observer<RecipientInputProps, HTMLInputElement>(
if ("getNameService" in recipientConfig) {
const icns = recipientConfig.getNameService("icns");
const ens = recipientConfig.getNameService("ens");
const modularChainInfo = chainStore.getModularChain(
recipientConfig.chainId
);
if (
icns?.isEnabled &&
chainStore.getChain(recipientConfig.chainId).bech32Config !=
null &&
"cosmos" in modularChainInfo &&
modularChainInfo.cosmos.bech32Config != null &&
ens?.isEnabled &&
chainStore.isEvmChain(recipientConfig.chainId)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export const useInsufficientFeeAnalytics = (
analyticsAmplitudeStore.logEvent("view_insufficient_fee_error", {
pathname,
chainIdentifier: ChainIdHelper.parse(chainId).identifier,
chainName: chainStore.hasChain(chainId)
? chainStore.getChain(chainId).chainName
chainName: chainStore.hasModularChain(chainId)
? chainStore.getModularChain(chainId).chainName
: undefined,
feeCurrencyDenom: feeConfig.fees[0].currency.coinMinimalDenom,
});
Expand Down
45 changes: 27 additions & 18 deletions apps/extension/src/hooks/claim/use-cosmos-claim-rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from "../../config.ui";
import { MakeTxResponse } from "@keplr-wallet/stores";
import { logNobleClaimAnalytics } from "../../analytics-amplitude";
import { ChainIdHelper } from "@keplr-wallet/cosmos";

const zeroDec = new Dec(0);
// TODO: Add below property to config.ui.ts
Expand All @@ -49,7 +50,7 @@ export const useCosmosClaimRewards = () => {
rewardToken: CoinPretty,
state: ClaimAllEachState
) => {
const chainInfo = chainStore.getChain(chainId);
const chainInfo = chainStore.getModularChain(chainId);
const account = accountStore.getAccount(chainId);
if (!account.bech32Address) {
return;
Expand Down Expand Up @@ -117,15 +118,22 @@ export const useCosmosClaimRewards = () => {
state.setIsLoading(true);

(async () => {
if (!("cosmos" in chainInfo)) {
return;
}
// feemarket feature가 있는 경우 이후의 로직에서 사용할 수 있는 fee currency를 찾아야하기 때문에 undefined로 시작시킨다.
let feeCurrency = chainInfo.hasFeature("feemarket")
let feeCurrency = chainInfo.cosmos.features?.includes("feemarket")
? undefined
: chainInfo.feeCurrencies.find(
: chainInfo.cosmos.feeCurrencies.find(
(cur) =>
cur.coinMinimalDenom === chainInfo.stakeCurrency?.coinMinimalDenom
cur.coinMinimalDenom ===
chainInfo.cosmos.stakeCurrency?.coinMinimalDenom
);

if (chainInfo.hasFeature("osmosis-base-fee-beta") && feeCurrency) {
if (
chainInfo.cosmos.features?.includes("osmosis-base-fee-beta") &&
feeCurrency
) {
const queryBaseFee = queriesStore.get(chainInfo.chainId).osmosis
.queryBaseFee;
const queryRemoteBaseFeeStep = queriesStore.simpleQuery.queryGet<{
Expand Down Expand Up @@ -186,7 +194,7 @@ export const useCosmosClaimRewards = () => {
| undefined;

const feeCurrencies = await (async () => {
if (chainInfo.hasFeature("feemarket")) {
if (chainInfo.cosmos.features?.includes("feemarket")) {
const queryFeeMarketGasPrices =
queriesStore.get(chainId).cosmos.queryFeeMarketGasPrices;
await queryFeeMarketGasPrices.waitFreshResponse();
Expand All @@ -200,9 +208,9 @@ export const useCosmosClaimRewards = () => {
continue;
}

const currency = await chainInfo.findCurrencyAsync(
gasPrice.denom
);
const currency = await chainStore
.getModularChainInfoImpl(chainId)
.findCurrencyAsync(gasPrice.denom);
if (currency) {
let multiplication = {
low: 1.1,
Expand Down Expand Up @@ -244,7 +252,7 @@ export const useCosmosClaimRewards = () => {
}
const specific =
multificationConfig.response.data[
chainInfo.chainIdentifier
ChainIdHelper.parse(chainId).identifier
];
if (
specific &&
Expand Down Expand Up @@ -288,13 +296,13 @@ export const useCosmosClaimRewards = () => {

return result;
} else {
return chainInfo.feeCurrencies;
return chainInfo.cosmos.feeCurrencies;
}
})();
for (const chainFeeCurrency of feeCurrencies) {
const currency = await chainInfo.findCurrencyAsync(
chainFeeCurrency.coinMinimalDenom
);
const currency = await chainStore
.getModularChainInfoImpl(chainId)
.findCurrencyAsync(chainFeeCurrency.coinMinimalDenom);
if (currency) {
const balance = queries.queryBalances
.getQueryBech32Address(account.bech32Address)
Expand Down Expand Up @@ -382,9 +390,10 @@ export const useCosmosClaimRewards = () => {
}

// Ensure fee currency fetched before querying balance
const feeCurrencyFetched = await chainInfo.findCurrencyAsync(
feeCurrency.coinMinimalDenom
);
const feeCurrencyFetched = await chainStore
.getModularChainInfoImpl(chainId)
.findCurrencyAsync(feeCurrency.coinMinimalDenom);

if (!feeCurrencyFetched) {
throw new Error(
intl.formatMessage({
Expand Down Expand Up @@ -592,7 +601,7 @@ export const useCosmosClaimRewards = () => {
chainId: string,
state: ClaimAllEachState
) => {
const cosmosChainInfo = chainStore.getChain(chainId);
const cosmosChainInfo = chainStore.getModularChain(chainId);
const account = accountStore.getAccount(chainId);
if (!account.bech32Address) {
return;
Expand Down
33 changes: 19 additions & 14 deletions apps/extension/src/hooks/use-buy-support-service-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ export const useBuySupportServiceInfos = (selectedTokenInfo?: {
Object.entries(
serviceInfo.buySupportCoinDenomsByChainId
).reduce((finalAcc, [chainId, coinDenoms]) => {
if (chainStore.hasChain(chainId)) {
if (chainStore.hasModularChain(chainId)) {
const currencyCodeMap = coinDenoms?.reduce(
(acc, coinDenom) => {
const chainInfo = chainStore.getChain(chainId);
const matchedCurrency = chainInfo.currencies.find(
(currency) => currency.coinDenom === coinDenom
);
const chainInfo =
chainStore.getModularChainInfoImpl(chainId);
const matchedCurrency = chainInfo
.getCurrencies()
.find((currency) => currency.coinDenom === coinDenom);
const currencyCode = getCurrencyCodeForMoonpay(
matchedCurrency?.coinDenom
);
Expand Down Expand Up @@ -106,13 +107,16 @@ export const useBuySupportServiceInfos = (selectedTokenInfo?: {
serviceInfo.buySupportCoinDenomsByChainId
).reduce(
(finalAcc, [chainId, coinDenoms]) => {
if (chainStore.hasChain(chainId)) {
const chainInfo = chainStore.getChain(chainId);
if (chainStore.hasModularChain(chainId)) {
const chainInfo =
chainStore.getModularChainInfoImpl(chainId);
const coins = coinDenoms?.reduce(
(coinsAcc, coinDenom) => {
const matchedCurrency = chainInfo.currencies.find(
(currency) => currency.coinDenom === coinDenom
);
const matchedCurrency = chainInfo
.getCurrencies()
.find(
(currency) => currency.coinDenom === coinDenom
);

if (matchedCurrency) {
const currencyCode = matchedCurrency.coinDenom;
Expand Down Expand Up @@ -161,10 +165,11 @@ export const useBuySupportServiceInfos = (selectedTokenInfo?: {
(modularChainInfo) => modularChainInfo.chainId === chainId
);

if (chainStore.hasChain(chainId)) {
const address = chainStore.isEvmChain(chainId)
? accountStore.getAccount(chainId).ethereumHexAddress
: accountStore.getAccount(chainId).bech32Address;
if (chainStore.hasModularChain(chainId)) {
const address =
modularChainInfo && "evm" in modularChainInfo
? accountStore.getAccount(chainId).ethereumHexAddress
: accountStore.getAccount(chainId).bech32Address;

coinDenoms.forEach((coinDenom) => {
if (!seenCoinDenoms.has(coinDenom)) {
Expand Down
5 changes: 3 additions & 2 deletions apps/extension/src/hooks/use-get-apy.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { ChainIdHelper } from "@keplr-wallet/cosmos";
import { useStore } from "../stores";
import { Dec } from "@keplr-wallet/unit";

export function useGetEarnApy(chainId: string) {
const { queriesStore, chainStore } = useStore();
const { queriesStore } = useStore();

const queryAPY = queriesStore.simpleQuery.queryGet<{
earnApy: number;
}>(
"https://pjld2aanw3elvteui4gwyxgx4m0ceweg.lambda-url.us-west-2.on.aws",
`/earn-apy/${chainStore.getChain(chainId).chainIdentifier}`
`/earn-apy/${ChainIdHelper.parse(chainId).identifier}`
);

const aprAvailable =
Expand Down
5 changes: 4 additions & 1 deletion apps/extension/src/hooks/use-get-icns-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export const useGetIcnsName = (bech32Address?: string) => {
const icnsPrimaryName = (() => {
if (
uiConfigStore.icnsInfo &&
chainStore.hasChain(uiConfigStore.icnsInfo.chainId) &&
chainStore.hasModularChain(uiConfigStore.icnsInfo.chainId) &&
chainStore
.getModularChainInfoImpl(uiConfigStore.icnsInfo.chainId)
.matchModule("cosmos") &&
bech32Address
) {
const queries = queriesStore.get(uiConfigStore.icnsInfo.chainId);
Expand Down
Loading
Loading