Skip to content

Commit

Permalink
Merge branch 'chainapsis:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau authored Dec 30, 2024
2 parents c3e6906 + 51c08bc commit 178c7c6
Show file tree
Hide file tree
Showing 49 changed files with 546 additions and 398 deletions.
52 changes: 26 additions & 26 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keplr-wallet/extension",
"version": "0.12.165",
"version": "0.12.169",
"author": "chainapsis",
"license": "Apache-2.0",
"private": true,
Expand All @@ -26,31 +26,31 @@
"@ethersproject/transactions": "^5.7.0",
"@floating-ui/react": "^0.23.0",
"@floating-ui/react-dom": "^1.3.0",
"@keplr-wallet/analytics": "0.12.165",
"@keplr-wallet/background": "0.12.165",
"@keplr-wallet/chain-validator": "0.12.165",
"@keplr-wallet/common": "0.12.165",
"@keplr-wallet/cosmos": "0.12.165",
"@keplr-wallet/crypto": "0.12.165",
"@keplr-wallet/hooks": "0.12.165",
"@keplr-wallet/hooks-internal": "0.12.165",
"@keplr-wallet/hooks-starknet": "0.12.165",
"@keplr-wallet/ledger-cosmos": "0.12.165",
"@keplr-wallet/popup": "0.12.165",
"@keplr-wallet/proto-types": "0.12.165",
"@keplr-wallet/provider": "0.12.165",
"@keplr-wallet/router": "0.12.165",
"@keplr-wallet/router-extension": "0.12.165",
"@keplr-wallet/simple-fetch": "0.12.165",
"@keplr-wallet/stores": "0.12.165",
"@keplr-wallet/stores-core": "0.12.165",
"@keplr-wallet/stores-etc": "0.12.165",
"@keplr-wallet/stores-eth": "0.12.165",
"@keplr-wallet/stores-ibc": "0.12.165",
"@keplr-wallet/stores-internal": "0.12.165",
"@keplr-wallet/stores-starknet": "0.12.165",
"@keplr-wallet/types": "0.12.165",
"@keplr-wallet/unit": "0.12.165",
"@keplr-wallet/analytics": "0.12.169",
"@keplr-wallet/background": "0.12.169",
"@keplr-wallet/chain-validator": "0.12.169",
"@keplr-wallet/common": "0.12.169",
"@keplr-wallet/cosmos": "0.12.169",
"@keplr-wallet/crypto": "0.12.169",
"@keplr-wallet/hooks": "0.12.169",
"@keplr-wallet/hooks-internal": "0.12.169",
"@keplr-wallet/hooks-starknet": "0.12.169",
"@keplr-wallet/ledger-cosmos": "0.12.169",
"@keplr-wallet/popup": "0.12.169",
"@keplr-wallet/proto-types": "0.12.169",
"@keplr-wallet/provider": "0.12.169",
"@keplr-wallet/router": "0.12.169",
"@keplr-wallet/router-extension": "0.12.169",
"@keplr-wallet/simple-fetch": "0.12.169",
"@keplr-wallet/stores": "0.12.169",
"@keplr-wallet/stores-core": "0.12.169",
"@keplr-wallet/stores-etc": "0.12.169",
"@keplr-wallet/stores-eth": "0.12.169",
"@keplr-wallet/stores-ibc": "0.12.169",
"@keplr-wallet/stores-internal": "0.12.169",
"@keplr-wallet/stores-starknet": "0.12.169",
"@keplr-wallet/types": "0.12.169",
"@keplr-wallet/unit": "0.12.169",
"@keystonehq/animated-qr": "^0.8.6",
"@keystonehq/hw-app-base": "0.1.1",
"@keystonehq/hw-transport-webusb": "0.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const SceneComponent: FunctionComponent<
<animated.div
style={{
display: "grid",
gridTemplateColumns: "1fr",
gridTemplateColumns: "100%",
zIndex: index + 1,
width: to([sceneWidth], (sceneWidth) => {
return sceneWidth || "100%";
Expand Down
45 changes: 45 additions & 0 deletions apps/extension/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,51 @@ export const EmbedChainInfos: (ChainInfo | ModularChainInfo)[] = [
},
features: ["cosmwasm"],
},
{
chainId: "thorchain-1",
chainName: "THORChain",
chainSymbolImageUrl:
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/thorchain/chain.png",
rpc: "https://rpc-thorchain.keplr.app",
rest: "https://lcd-thorchain.keplr.app",
bip44: {
coinType: 931,
},
bech32Config: {
bech32PrefixAccAddr: "thor",
bech32PrefixAccPub: "thorpub",
bech32PrefixValAddr: "thorvaloper",
bech32PrefixValPub: "thorvaloperpub",
bech32PrefixConsAddr: "thorvalcons",
bech32PrefixConsPub: "thorvalconspub",
},
currencies: [
{
coinDenom: "RUNE",
coinMinimalDenom: "rune",
coinDecimals: 8,
coinGeckoId: "thorchain",
coinImageUrl:
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/thorchain/rune.png",
},
],
feeCurrencies: [
{
coinDenom: "RUNE",
coinMinimalDenom: "rune",
coinDecimals: 8,
coinGeckoId: "thorchain",
coinImageUrl:
"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/thorchain/rune.png",
gasPriceStep: {
low: 0.02,
average: 0.02,
high: 0.03,
},
},
],
features: [],
},
];

// The origins that are able to pass any permission that external webpages can have.
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/manifest.v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name": "Keplr",
"description": "Keplr is a browser extension wallet for the Inter blockchain ecosystem.",
"version": "0.12.165",
"version": "0.12.169",
"icons": {
"16": "assets/icon-16.png",
"48": "assets/icon-48.png",
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/manifest.v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name": "Keplr",
"description": "Keplr is a browser extension wallet for the Inter blockchain ecosystem.",
"version": "0.12.165",
"version": "0.12.169",
"icons": {
"16": "assets/icon-16.png",
"48": "assets/icon-48.png",
Expand Down
35 changes: 16 additions & 19 deletions apps/extension/src/pages/register/enable-chains/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ export const EnableChainsScene: FunctionComponent<{
const enabledChainIdentifiers: string[] =
chainStore.enabledChainIdentifiers;

// 모든 처리 이후에 모든 체인을 enable한다.
// 실제 로직은 계정이 만들어질때 최초에 자동으로 enable할 체인을 찾지 못할때
// (기존에 자산을 가진 계정을 찾을 수 없을때)
// 모든 체인을 eanble한다.
let enableAllChains = false;
// noble과 ethereum도 default로 활성화되어야 한다.
// 근데 enable-chains가 처음 register일때가 아니라
// manage chain visibility로부터 왔을수도 있다
Expand All @@ -353,25 +358,7 @@ export const EnableChainsScene: FunctionComponent<{
enabledChainIdentifiers[0] ===
chainStore.chainInfos[0].chainIdentifier
) {
if (
chainStore.chainInfos.find((c) => c.chainIdentifier === "noble")
) {
enabledChainIdentifiers.push("noble");
}

if (
chainStore.chainInfos.find((c) => c.chainIdentifier === "eip155:1")
) {
enabledChainIdentifiers.push("eip155:1");
}

if (
chainStore.modularChainInfos.find(
(m) => "starknet" in m && m.chainId === "starknet:SN_MAIN"
)
) {
enabledChainIdentifiers.push("starknet:SN_MAIN");
}
enableAllChains = true;
}

// 스타크넷 관련 체인들은 `candidateAddresses`에 추가되지 않으므로 여기서 enable 할지 판단한다.
Expand All @@ -390,6 +377,7 @@ export const EnableChainsScene: FunctionComponent<{
);

if (queryBalance && queryBalance.balance.toDec().gt(new Dec(0))) {
enableAllChains = false;
enabledChainIdentifiers.push(
ChainIdHelper.parse(modularChainInfo.chainId).identifier
);
Expand Down Expand Up @@ -453,11 +441,13 @@ export const EnableChainsScene: FunctionComponent<{
);
})
) {
enableAllChains = false;
enabledChainIdentifiers.push(chainInfo.chainIdentifier);
break;
}

if (isEVMOnlyChain && balance.balance.toDec().gt(new Dec(0))) {
enableAllChains = false;
enabledChainIdentifiers.push(chainInfo.chainIdentifier);
break;
}
Expand All @@ -469,13 +459,20 @@ export const EnableChainsScene: FunctionComponent<{
bech32Address.address
);
if (queryDelegations.delegationBalances.length > 0) {
enableAllChains = false;
enabledChainIdentifiers.push(chainInfo.chainIdentifier);
break;
}
}
}
}

if (enableAllChains) {
return chainStore.modularChainInfosInListUI.map(
(chainInfo) => ChainIdHelper.parse(chainInfo.chainId).identifier
);
}

return [...new Set(enabledChainIdentifiers)];
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,20 @@ const EthExecuteContractTxPretty: React.FunctionComponent<{
.replace(/([-_][a-z])/g, (group) =>
group.toUpperCase().replace("-", "").replace("_", "")
)
.replace(/([A-Z])/g, " $1");
.replace(
/([a-z])([A-Z]+(?=[A-Z][a-z]|$))|([A-Z][a-z])/g,
(match, lower, acronym, normalWord) => {
if (acronym) {
return `${lower} ${acronym}`;
}
if (normalWord) {
return ` ${normalWord}`;
}
return match;
}
)
.replace(/\s+/g, " ") // 불필요한 공백 제거
.trim();

return (
<React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { Coin } from "@keplr-wallet/types";
import { FormattedMessage } from "react-intl";
import { MessageSendIcon } from "../../../../../components/icon";
import { ItemLogo } from "../../../../main/token-detail/msg-items/logo";
import { Buffer } from "buffer/";
import { MsgSend as ThorMsgSend } from "@keplr-wallet/proto-types/thorchain/v1/types/msg_send";

export const SendMessage: IMessageRenderer = {
Expand All @@ -27,12 +26,8 @@ export const SendMessage: IMessageRenderer = {
if ("type" in msg && msg.type === "thorchain/MsgSend") {
return {
amount: msg.value.amount,
fromAddress: new Bech32Address(
Buffer.from(msg.value.from_address, "base64")
).toBech32("thor"),
toAddress: new Bech32Address(
Buffer.from(msg.value.to_address, "base64")
).toBech32("thor"),
fromAddress: msg.value.from_address,
toAddress: msg.value.to_address,
};
}

Expand Down
11 changes: 10 additions & 1 deletion apps/extension/src/pages/sign/ethereum/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,16 @@ export const EthereumSigningView: FunctionComponent<{
const text = (() => {
const string = signingDataBuff.toString("utf8");
if (string.startsWith("0x")) {
return Buffer.from(string.slice(2), "hex").toString("utf8");
const buf = Buffer.from(string.slice(2), "hex");
try {
// 정상적인 utf-8 문자열인지 확인
const decoder = new TextDecoder("utf-8", { fatal: true });
decoder.decode(new Uint8Array(buf)); // UTF-8 변환 시도
} catch {
return buf.toString("hex");
}

return buf.toString("utf8");
}

return string;
Expand Down
12 changes: 6 additions & 6 deletions apps/hooks-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keplr-wallet/hooks-internal",
"version": "0.12.165",
"version": "0.12.169",
"main": "build/index.js",
"author": "chainapsis",
"license": "Apache-2.0",
Expand All @@ -14,11 +14,11 @@
"lint-fix": "eslint --fix \"src/**/*\" && prettier --write \"src/**/*\""
},
"dependencies": {
"@keplr-wallet/hooks": "0.12.165",
"@keplr-wallet/stores": "0.12.165",
"@keplr-wallet/stores-internal": "0.12.165",
"@keplr-wallet/types": "0.12.165",
"@keplr-wallet/unit": "0.12.165"
"@keplr-wallet/hooks": "0.12.169",
"@keplr-wallet/stores": "0.12.169",
"@keplr-wallet/stores-internal": "0.12.169",
"@keplr-wallet/types": "0.12.169",
"@keplr-wallet/unit": "0.12.169"
},
"peerDependencies": {
"mobx": "^6",
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keplr-wallet/mobile",
"version": "0.12.165",
"version": "0.12.169",
"private": true,
"installConfig": {
"hoistingLimits": "workspaces"
Expand Down
14 changes: 7 additions & 7 deletions apps/stores-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keplr-wallet/stores-internal",
"version": "0.12.165",
"version": "0.12.169",
"main": "build/index.js",
"author": "chainapsis",
"license": "Apache-2.0",
Expand All @@ -14,12 +14,12 @@
"lint-fix": "eslint --fix \"src/**/*\" && prettier --write \"src/**/*\""
},
"dependencies": {
"@keplr-wallet/common": "0.12.165",
"@keplr-wallet/cosmos": "0.12.165",
"@keplr-wallet/simple-fetch": "0.12.165",
"@keplr-wallet/stores": "0.12.165",
"@keplr-wallet/types": "0.12.165",
"@keplr-wallet/unit": "0.12.165",
"@keplr-wallet/common": "0.12.169",
"@keplr-wallet/cosmos": "0.12.169",
"@keplr-wallet/simple-fetch": "0.12.169",
"@keplr-wallet/stores": "0.12.169",
"@keplr-wallet/types": "0.12.169",
"@keplr-wallet/unit": "0.12.169",
"joi": "^17.5.0",
"utility-types": "^3.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ This is an experimental implementation of [ADR-36](https://github.com/cosmos/cos

Its main usage is to prove ownership of an account off-chain, requesting ADR-36 signature using the `signArbitrary` API.

If requested sign doc with the `signAnimo` API with the ADR-36 that Keplr requires instead of using the `signArbitary` API, it would function as `signArbitary`
If requested sign doc with the `signAmino` API with the ADR-36 that Keplr requires instead of using the `signArbitrary` API, it would function as `signArbitrary`
- Only supports sign doc in the format of Amino. (in the case of protobuf, [ADR-36](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-036-arbitrary-signature.md) requirements aren't fully specified for implementation)
- sign doc message should be single and the message type should be "sign/MsgSignData"
- sign doc "sign/MsgSignData" message should have "signer" and "data" as its value. "data" should be base64 encoded
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.12.165",
"version": "0.12.169",
"useWorkspaces": true,
"npmClient": "yarn",
"command": {
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keplr-wallet/analytics",
"version": "0.12.165",
"version": "0.12.169",
"main": "build/index.js",
"author": "chainapsis",
"license": "Apache-2.0",
Expand Down
Loading

0 comments on commit 178c7c6

Please sign in to comment.