Skip to content

Commit f9bdcb3

Browse files
committed
Merge remote-tracking branch 'origin/develop' into editaahn/refactor-modular-merge
2 parents 16d6d9f + bc29469 commit f9bdcb3

File tree

52 files changed

+633
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+633
-436
lines changed

apps/extension/package.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@keplr-wallet/extension",
3-
"version": "0.12.292",
3+
"version": "0.12.296",
44
"author": "chainapsis",
55
"license": "Apache-2.0",
66
"private": true,
@@ -26,34 +26,34 @@
2626
"@ethersproject/transactions": "^5.7.0",
2727
"@floating-ui/react": "^0.23.0",
2828
"@floating-ui/react-dom": "^1.3.0",
29-
"@keplr-wallet/analytics": "0.12.292",
30-
"@keplr-wallet/background": "0.12.292",
31-
"@keplr-wallet/chain-validator": "0.12.292",
32-
"@keplr-wallet/common": "0.12.292",
33-
"@keplr-wallet/cosmos": "0.12.292",
34-
"@keplr-wallet/crypto": "0.12.292",
35-
"@keplr-wallet/hooks": "0.12.292",
36-
"@keplr-wallet/hooks-bitcoin": "0.12.292",
37-
"@keplr-wallet/hooks-internal": "0.12.292",
38-
"@keplr-wallet/hooks-starknet": "0.12.292",
39-
"@keplr-wallet/ledger-cosmos": "0.12.292",
40-
"@keplr-wallet/popup": "0.12.292",
41-
"@keplr-wallet/proto-types": "0.12.292",
42-
"@keplr-wallet/provider": "0.12.292",
43-
"@keplr-wallet/router": "0.12.292",
44-
"@keplr-wallet/router-extension": "0.12.292",
45-
"@keplr-wallet/simple-fetch": "0.12.292",
46-
"@keplr-wallet/stores": "0.12.292",
47-
"@keplr-wallet/stores-bitcoin": "0.12.292",
48-
"@keplr-wallet/stores-core": "0.12.292",
49-
"@keplr-wallet/stores-etc": "0.12.292",
50-
"@keplr-wallet/stores-eth": "0.12.292",
51-
"@keplr-wallet/stores-ibc": "0.12.292",
52-
"@keplr-wallet/stores-internal": "0.12.292",
53-
"@keplr-wallet/stores-starknet": "0.12.292",
54-
"@keplr-wallet/topup-client": "0.12.292",
55-
"@keplr-wallet/types": "0.12.292",
56-
"@keplr-wallet/unit": "0.12.292",
29+
"@keplr-wallet/analytics": "0.12.296",
30+
"@keplr-wallet/background": "0.12.296",
31+
"@keplr-wallet/chain-validator": "0.12.296",
32+
"@keplr-wallet/common": "0.12.296",
33+
"@keplr-wallet/cosmos": "0.12.296",
34+
"@keplr-wallet/crypto": "0.12.296",
35+
"@keplr-wallet/hooks": "0.12.296",
36+
"@keplr-wallet/hooks-bitcoin": "0.12.296",
37+
"@keplr-wallet/hooks-internal": "0.12.296",
38+
"@keplr-wallet/hooks-starknet": "0.12.296",
39+
"@keplr-wallet/ledger-cosmos": "0.12.296",
40+
"@keplr-wallet/popup": "0.12.296",
41+
"@keplr-wallet/proto-types": "0.12.296",
42+
"@keplr-wallet/provider": "0.12.296",
43+
"@keplr-wallet/router": "0.12.296",
44+
"@keplr-wallet/router-extension": "0.12.296",
45+
"@keplr-wallet/simple-fetch": "0.12.296",
46+
"@keplr-wallet/stores": "0.12.296",
47+
"@keplr-wallet/stores-bitcoin": "0.12.296",
48+
"@keplr-wallet/stores-core": "0.12.296",
49+
"@keplr-wallet/stores-etc": "0.12.296",
50+
"@keplr-wallet/stores-eth": "0.12.296",
51+
"@keplr-wallet/stores-ibc": "0.12.296",
52+
"@keplr-wallet/stores-internal": "0.12.296",
53+
"@keplr-wallet/stores-starknet": "0.12.296",
54+
"@keplr-wallet/topup-client": "0.12.296",
55+
"@keplr-wallet/types": "0.12.296",
56+
"@keplr-wallet/unit": "0.12.296",
5757
"@keystonehq/animated-qr": "^0.8.6",
5858
"@keystonehq/hw-app-base": "0.1.1",
5959
"@keystonehq/hw-transport-webusb": "0.4.0",

apps/extension/src/config.ts

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,14 +2332,26 @@ export const EmbedChainInfos: (ChainInfo | ModularChainInfo)[] = [
23322332
type: "erc20",
23332333
contractAddress:
23342334
"0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
2335-
coinDenom: "USDC",
2335+
coinDenom: "USDC.e",
23362336
coinMinimalDenom:
23372337
"erc20:0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
23382338
coinDecimals: 6,
23392339
coinGeckoId: "usd-coin",
23402340
coinImageUrl:
23412341
"https://keplr-ext-update-note-images.s3.amazonaws.com/token/usdc.png",
23422342
},
2343+
{
2344+
type: "erc20",
2345+
contractAddress:
2346+
"0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
2347+
coinDenom: "USDC",
2348+
coinMinimalDenom:
2349+
"erc20:0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
2350+
coinDecimals: 6,
2351+
coinGeckoId: "usd-coin",
2352+
coinImageUrl:
2353+
"https://keplr-ext-update-note-images.s3.amazonaws.com/token/usdc.png",
2354+
},
23432355
{
23442356
type: "erc20",
23452357
contractAddress:
@@ -2443,7 +2455,6 @@ export const EmbedChainInfos: (ChainInfo | ModularChainInfo)[] = [
24432455
coinMinimalDenom:
24442456
"erc20:0x0512feac6339ff7889822cb5aa2a86c848e9d392bb0e3e237c008674feed8343",
24452457
coinDecimals: 6,
2446-
coinGeckoId: "usd-coin",
24472458
coinImageUrl:
24482459
"https://keplr-ext-update-note-images.s3.amazonaws.com/token/usdc.png",
24492460
},
@@ -3896,6 +3907,51 @@ export const EmbedChainInfos: (ChainInfo | ModularChainInfo)[] = [
38963907
],
38973908
features: ["cosmwasm"],
38983909
},
3910+
{
3911+
rpc: "https://rpc.monad.xyz",
3912+
rest: "https://rpc.monad.xyz",
3913+
evm: {
3914+
chainId: 143,
3915+
rpc: "https://rpc.monad.xyz",
3916+
websocket: "wss://rpc.monad.xyz",
3917+
},
3918+
chainId: "eip155:143",
3919+
chainName: "Monad Mainnet",
3920+
chainSymbolImageUrl:
3921+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/eip155:143/chain.png",
3922+
bip44: {
3923+
coinType: 60,
3924+
},
3925+
currencies: [
3926+
{
3927+
coinDenom: "MON",
3928+
coinMinimalDenom: "monad-native",
3929+
coinDecimals: 18,
3930+
coinGeckoId: "monad",
3931+
coinImageUrl:
3932+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/eip155:143/monad-native.png",
3933+
},
3934+
{
3935+
coinDenom: "WMON",
3936+
coinMinimalDenom: "erc20:0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
3937+
coinDecimals: 18,
3938+
coinGeckoId: "wrapped-monad",
3939+
coinImageUrl:
3940+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/eip155:143/erc20/0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A.png",
3941+
},
3942+
],
3943+
feeCurrencies: [
3944+
{
3945+
coinDenom: "MON",
3946+
coinMinimalDenom: "monad-native",
3947+
coinDecimals: 18,
3948+
coinGeckoId: "monad",
3949+
coinImageUrl:
3950+
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/eip155:143/monad-native.png",
3951+
},
3952+
],
3953+
features: [],
3954+
},
38993955
];
39003956

39013957
// The origins that are able to pass any permission that external webpages can have.

apps/extension/src/manifest.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "Keplr",
55
"description": "Keplr is a browser extension wallet for the Inter blockchain ecosystem.",
6-
"version": "0.12.292",
6+
"version": "0.12.296",
77
"icons": {
88
"16": "assets/icon-16.png",
99
"48": "assets/icon-48.png",

apps/extension/src/manifest.v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "Keplr",
55
"description": "Keplr is a browser extension wallet for the Inter blockchain ecosystem.",
6-
"version": "0.12.292",
6+
"version": "0.12.296",
77
"icons": {
88
"16": "assets/icon-16.png",
99
"48": "assets/icon-48.png",

apps/extension/src/pages/main/components/rewards-card/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ const ClaimAllButton: FunctionComponent<ClaimAllButtonProps> = ({
228228
isHover,
229229
setIsHover,
230230
}) => {
231+
const theme = useTheme();
232+
231233
const [isPressed, setIsPressed] = React.useState(false);
232234
const [labelWidth, setLabelWidth] = React.useState<number>();
233235
const claimTextRef = React.useRef<HTMLSpanElement | null>(null);
@@ -315,6 +317,8 @@ const ClaimAllButton: FunctionComponent<ClaimAllButtonProps> = ({
315317
color={
316318
claimAllDisabled
317319
? ColorPalette["gray-300"]
320+
: theme.mode === "light"
321+
? ColorPalette["blue-400"]
318322
: ColorPalette["blue-300"]
319323
}
320324
/>
@@ -325,6 +329,8 @@ const ClaimAllButton: FunctionComponent<ClaimAllButtonProps> = ({
325329
color={
326330
claimAllDisabled
327331
? ColorPalette["gray-300"]
332+
: theme.mode === "light"
333+
? ColorPalette["blue-400"]
328334
: ColorPalette["blue-300"]
329335
}
330336
>

apps/extension/src/pages/main/components/update-note-modal/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { InExtensionMessageRequester } from "@keplr-wallet/router-extension";
2121
import { BACKGROUND_PORT } from "@keplr-wallet/router";
2222
import { observer } from "mobx-react-lite";
2323
import { useStore } from "../../../../stores";
24+
import { ParagraphWithLinks } from "./paragraph-with-links";
2425

2526
export type UpdateNotePageData = {
2627
title: string;
@@ -32,6 +33,9 @@ export type UpdateNotePageData = {
3233
}
3334
| undefined;
3435
paragraph: string;
36+
links?: {
37+
[key: string]: string;
38+
};
3539
isSidePanelBeta?: boolean;
3640
};
3741

@@ -271,13 +275,9 @@ const CarouselPage: FunctionComponent<{
271275
: ColorPalette["gray-100"]
272276
}
273277
>
274-
<FormattedMessage
275-
id="update-node/paragraph/noop"
276-
defaultMessage={notePageData.paragraph}
277-
values={{
278-
br: <br />,
279-
b: (...chunks: any) => <b>{chunks}</b>,
280-
}}
278+
<ParagraphWithLinks
279+
paragraph={notePageData.paragraph}
280+
links={notePageData.links}
281281
/>
282282
</Body2>
283283
</Box>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import React, { FunctionComponent } from "react";
2+
import { FormattedMessage } from "react-intl";
3+
import styled from "styled-components";
4+
import { ColorPalette } from "../../../../styles";
5+
import { UpdateNotePageData } from ".";
6+
7+
const Styles = {
8+
Link: styled.span`
9+
color: ${(props) =>
10+
props.theme.mode === "light"
11+
? ColorPalette["gray-600"]
12+
: ColorPalette["gray-50"]};
13+
14+
cursor: pointer;
15+
text-decoration: underline;
16+
`,
17+
};
18+
19+
export const ParagraphWithLinks: FunctionComponent<{
20+
paragraph: string;
21+
links?: UpdateNotePageData["links"];
22+
}> = ({ paragraph, links }) => {
23+
return (
24+
<FormattedMessage
25+
id="update-node/paragraph/noop"
26+
defaultMessage={paragraph}
27+
values={{
28+
br: <br />,
29+
b: (...chunks: React.ReactNode[]) => <b>{chunks}</b>,
30+
link: links
31+
? (...chunks: React.ReactNode[]) => {
32+
const flattenedChunks: React.ReactNode[] = [];
33+
34+
for (const chunk of chunks) {
35+
if (Array.isArray(chunk)) {
36+
flattenedChunks.push(...chunk);
37+
} else {
38+
flattenedChunks.push(chunk);
39+
}
40+
}
41+
42+
const linkText = flattenedChunks
43+
.filter(
44+
(chunk): chunk is string | number =>
45+
typeof chunk === "string" || typeof chunk === "number"
46+
)
47+
.map((chunk) => String(chunk))
48+
.join("")
49+
.trim();
50+
51+
const url = links[linkText];
52+
53+
if (url) {
54+
return (
55+
<Styles.Link
56+
onClick={(e) => {
57+
e.preventDefault();
58+
59+
browser.tabs.create({ url });
60+
}}
61+
>
62+
{chunks}
63+
</Styles.Link>
64+
);
65+
}
66+
67+
return <React.Fragment>{chunks}</React.Fragment>;
68+
}
69+
: undefined,
70+
}}
71+
/>
72+
);
73+
};

apps/extension/src/pages/main/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ export const MainPage: FunctionComponent<{
488488
}
489489
: undefined,
490490
paragraph: scene.paragraph,
491+
links: scene.links,
491492
isSidePanelBeta: info.isSidePanelBeta,
492493
});
493494
}

apps/extension/src/stores/huge-queries/index.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,8 @@ export class HugeQueriesStore {
11731173
// - 토큰의 recommendedSymbol이 이미 존재하는 그룹의 coinDenom과 일치하면(ERC20 그룹) 해당 그룹에 추가
11741174
// - 일치하는 그룹이 없으면 recommendedSymbol을 키로 새 그룹 생성
11751175
// 3. BTC 토큰들은 linkedChainKey를 키로 그룹화
1176-
// 4. 나머지 Unknown 토큰들은 단일 그룹으로 처리
1176+
// 4. Starknet 메인넷 토큰들은 coinGeckoId로 그룹화
1177+
// 5. 나머지 Unknown 토큰들은 단일 그룹으로 처리
11771178
@computed
11781179
get groupedTokensMap(): Map<string, ViewToken[]> {
11791180
const tokensMap = new Map<string, ViewToken[]>();
@@ -1263,6 +1264,29 @@ export class HugeQueriesStore {
12631264
}
12641265
}
12651266

1267+
// Starknet
1268+
for (const viewToken of allKnownBalances) {
1269+
if (processedTokens.has(viewToken)) {
1270+
continue;
1271+
}
1272+
1273+
const modularChainInfo = viewToken.chainInfo;
1274+
1275+
if ("starknet" in modularChainInfo && !modularChainInfo.isTestnet) {
1276+
const currency = viewToken.token.currency;
1277+
1278+
if (currency.coinGeckoId) {
1279+
const groupKey = this.findGroupKeyByCoinGeckoId(
1280+
currency.coinGeckoId,
1281+
tokensMap
1282+
);
1283+
1284+
this.addTokenToGroup(groupKey, viewToken, tokensMap);
1285+
processedTokens.set(viewToken, true);
1286+
}
1287+
}
1288+
}
1289+
12661290
// Unknown
12671291
for (const viewToken of allKnownBalances) {
12681292
if (processedTokens.has(viewToken)) {
@@ -1428,6 +1452,21 @@ export class HugeQueriesStore {
14281452
return `erc20:${recommendedSymbol}/${coinGeckoId}`;
14291453
}
14301454

1455+
protected findGroupKeyByCoinGeckoId(
1456+
coinGeckoId: string,
1457+
tokensMap: Map<string, ViewToken[]>
1458+
): string {
1459+
for (const [key, viewTokens] of tokensMap.entries()) {
1460+
if (viewTokens.length === 0) continue;
1461+
1462+
if (viewTokens[0].token.currency.coinGeckoId === coinGeckoId) {
1463+
return key;
1464+
}
1465+
}
1466+
1467+
return coinGeckoId;
1468+
}
1469+
14311470
protected addTokenToGroup(
14321471
groupKey: string,
14331472
token: ViewToken,

0 commit comments

Comments
 (0)