Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 40 additions & 3 deletions packages/components/svg/illus/terra.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/core/src/chains/cosmos/sdkCosmos/query/IQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ class QueryRegistry {
export const queryRegistry = new QueryRegistry();
const cosmwasmQuery = new CosmwasmQuery();
queryRegistry.register(getNetworkIdsMap().juno, cosmwasmQuery);
// queryRegistry.register(getNetworkIdsMap().terra, cosmwasmQuery); // terra2
queryRegistry.register(getNetworkIdsMap().terra, cosmwasmQuery); // Terra Classic
queryRegistry.register(getNetworkIdsMap().osmosis, cosmwasmQuery);
queryRegistry.register(getNetworkIdsMap().secretnetwork, new SecretwasmQuery());

const mintScanQuery = new MintScanQuery();
queryRegistry.register(getNetworkIdsMap().cosmoshub, mintScanQuery);
queryRegistry.register(getNetworkIdsMap().akash, mintScanQuery);
// queryRegistry.register(getNetworkIdsMap().terra, mintScanQuery); // Terra Classic
queryRegistry.register(getNetworkIdsMap().fetch, mintScanQuery);
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const NetworkIDMinScanMap: Record<string, string> = {
[getNetworkIdsMap().cronosposchain]: 'cryptoorg',
[getNetworkIdsMap().cosmoshub]: 'cosmos',
[getNetworkIdsMap().akash]: 'akash',
[getNetworkIdsMap().terra]: 'terra',
[getNetworkIdsMap().fetch]: 'fetchai',
[getNetworkIdsMap().juno]: 'juno',
[getNetworkIdsMap().osmosis]: 'osmosis',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
COINTYPE_BTC,
COINTYPE_CFX,
COINTYPE_CKB,
COINTYPE_COSMOS,
COINTYPE_COSMOS,
COINTYPE_DNX,
Comment on lines +11 to 12
Copy link
Contributor

@coderabbitai coderabbitai bot Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing Terra coin-type mapping – migration will drop user accounts.

Terra uses BIP-44 coin-type 330 (COINTYPE_TERRA). It is not imported or mapped, so any v4 wallet holding LUNC/USTC addresses will lose its link during migration.

@@
   COINTYPE_COSMOS,  
+  COINTYPE_TERRA,
@@
   [COINTYPE_COSMOS]: networkIdsMap.cosmoshub, 
+  [COINTYPE_TERRA]: networkIdsMap.terra,

⚠️ This fix also relies on networkIdsMap.terra being defined – ensure the previous file registers terra correctly.

Also applies to: 56-56

🤖 Prompt for AI Agents
In packages/kit-bg/src/migrations/v4ToV5Migration/v4CoinTypeToNetworkId.ts
around lines 11 to 12 and line 56, the Terra coin-type (BIP-44 coin-type 330,
COINTYPE_TERRA) is missing from the coin-type to network ID mapping, which will
cause user accounts with Terra addresses to be dropped during migration. Add the
import for COINTYPE_TERRA and include it in the mapping to networkIdsMap.terra.
Also verify that networkIdsMap.terra is properly defined in the related file to
ensure the migration handles Terra wallets correctly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@originalix should i build the COINTYPE_TERRA ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

COINTYPE_DOGE,
COINTYPE_DOT,
Expand Down Expand Up @@ -53,7 +53,7 @@ export const v4CoinTypeToNetworkId: Partial<
[COINTYPE_NEURAI]: networkIdsMap.xna,
[COINTYPE_BCH]: networkIdsMap.bch,
[COINTYPE_XRP]: networkIdsMap.xrp,
[COINTYPE_COSMOS]: networkIdsMap.cosmoshub,
[COINTYPE_COSMOS]: networkIdsMap.cosmoshub,
[COINTYPE_ADA]: networkIdsMap.ada,
[COINTYPE_SUI]: networkIdsMap.sui,
[COINTYPE_FIL]: networkIdsMap.fil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const v4PresetNetworkIds = [
'cfx--1029',
'cfx--1',
'cosmos--akashnet-2',
'cosmos--columbus-5',
'cosmos--cosmoshub-4',
'cosmos--crypto-org-chain-mainnet-1',
'cosmos--fetchhub-4',
Expand Down
5 changes: 5 additions & 0 deletions packages/kit-bg/src/vaults/impls/cosmos/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ const settings: IVaultSettings = {
curve: 'secp256k1',
nativeTokenAddress: 'uakt',
},
'cosmos--columbus-5': {
addressPrefix: 'terra',
curve: 'secp256k1',
nativeTokenAddress: 'uluna',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect Native Token Address for Terra Classic

The nativeTokenAddress for cosmos--columbus-5 (Terra Classic) is incorrectly set to uluna. It should be ulunc to match the LUNC native token's micro-denomination, consistent with the LUNC symbol configured in presetNetworks.ts. This inconsistency will lead to incorrect token handling.

Fix in Cursor Fix in Web

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
'cosmos--crypto-org-chain-mainnet-1': {
addressPrefix: 'cro',
curve: 'secp256k1',
Expand Down
22 changes: 21 additions & 1 deletion packages/shared/src/config/presetNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,25 @@ const akash: IServerNetwork = {
'defaultEnabled': true,
'status': ENetworkStatus.LISTED,
};

const terra: IServerNetwork = {
'chainId': 'columbus-5',
'code': 'terra',
'decimals': 6,
'id': 'cosmos--columbus-5',
'impl': 'cosmos',
'isTestnet': false,
'logoURI': 'https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/columbus/chain.png',
'name': 'Terra Classic',
'shortcode': 'terra',
'shortname': 'terra',
'symbol': 'LUNC',
'feeMeta': {
'decimals': 6,
'symbol': 'LUNC',
},
'defaultEnabled': true,
'status': ENetworkStatus.LISTED,
};
const cronosPosChain: IServerNetwork = {
'chainId': 'crypto-org-chain-mainnet-1',
'code': 'cronosposchain',
Expand Down Expand Up @@ -2918,6 +2936,7 @@ export const presetNetworksMap = {
secret,
juno,
fetchai,
terra,
cronosPosChain,
akash,
osmosis,
Expand Down Expand Up @@ -3112,6 +3131,7 @@ export const getPresetNetworks = memoFn((): IServerNetwork[] => {
secret,
juno,
fetchai,
terra,
cronosPosChain,
akash,
osmosis,
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/types/earn/earnProvider.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const isSupportStaking = (symbol: string) =>
export const earnMainnetNetworkIds = [
getNetworkIdsMap().eth,
getNetworkIdsMap().cosmoshub,
getNetworkIdsMap().terra,
getNetworkIdsMap().apt,
getNetworkIdsMap().sol,
getNetworkIdsMap().btc,
Expand Down Expand Up @@ -186,6 +187,7 @@ export function getSymbolSupportedNetworks(): Record<
'SOL': [networkIdsMap.sol],
'APT': [networkIdsMap.apt],
'ATOM': [networkIdsMap.cosmoshub],
'LUNC': [networkIdsMap.terra],
'POL': [networkIdsMap.eth],
'USDC': [networkIdsMap.eth, networkIdsMap.sui],
'USDT': [networkIdsMap.eth],
Expand Down