Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
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 @@ -9,6 +9,7 @@ import {
COINTYPE_CFX,
COINTYPE_CKB,
COINTYPE_COSMOS,
COINTYPE_TERRA,
COINTYPE_DNX,
COINTYPE_DOGE,
COINTYPE_DOT,
Expand Down Expand Up @@ -54,6 +55,7 @@ export const v4CoinTypeToNetworkId: Partial<
[COINTYPE_BCH]: networkIdsMap.bch,
[COINTYPE_XRP]: networkIdsMap.xrp,
[COINTYPE_COSMOS]: networkIdsMap.cosmoshub,
[COINTYPE_TERRA]: networkIdsMap.terra,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is COINTYPE_TERRA different from COINTYPE_COSMOS ?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Terra uses more native coins LUNC / USTC / KRW should i add them or keep it only on uluna (LUNC ) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

We currently only support one native token.

[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
20 changes: 19 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://uni.onekey-asset.com/static/chain/terra.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
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