Skip to content

Commit

Permalink
Merge branch 'develop' into feat/cfe-393-combine-query-execute
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed Apr 29, 2024
2 parents e693da9 + 524222f commit c56b800
Show file tree
Hide file tree
Showing 20 changed files with 229 additions and 31 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#897](https://github.com/alleslabs/celatone-frontend/pull/897) Add config for lite version support

### Improvements

- [#872](https://github.com/alleslabs/celatone-frontend/pull/872) Change Query/Execute page to Interact Contract
- [#895](https://github.com/alleslabs/celatone-frontend/pull/895) Show collection address and creator on the collection list page

### Bug fixes

Expand Down
1 change: 1 addition & 0 deletions src/config/chain/default.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ChainConfig } from "./types";

export const DEFAULT_CHAIN_CONFIG: ChainConfig = {
tier: "lite",
chain: "",
registryChainName: "",
prettyName: "",
Expand Down
53 changes: 53 additions & 0 deletions src/config/chain/initia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,56 @@ const INITIA_DECODER =
"https://initia-api-jiod42ec2q-as.a.run.app/decode_module";

export const INITIA_CHAIN_CONFIGS: ChainConfigs = {
"tomcat-1-lite": {
tier: "lite",
chain: "initia",
registryChainName: "blackwingdevnet1",
prettyName: "Blackwing Closed Testnet 1 Lite",
lcd: "https://maze-rest-c64ef367-a391-4e71-901e-87951e5e9030.ue1-prod.newmetric.xyz",
rpc: "https://maze-rpc-c64ef367-a391-4e71-901e-87951e5e9030.ue1-prod.newmetric.xyz",
indexer: "https://tomcat-1-graphql.alleslabs.dev/v1/graphql",
wallets: [...initiaWallets, ...keplrWallets],
features: {
faucet: {
enabled: false,
},
wasm: {
enabled: false,
},
move: {
enabled: true,
moduleMaxFileSize: 1_048_576,
decodeApi: INITIA_DECODER,
verify: "",
},
pool: {
enabled: false,
},
publicProject: {
enabled: true,
},
gov: {
enabled: false,
},
nft: {
enabled: true,
},
},
gas: {
gasPrice: {
tokenPerGas: 0.151,
denom:
"l2/ad2344d0c17127cc6bce67e360f43cd6c5fa09a7b5f6f9b7b80f9dc3e0c4876e",
},
gasAdjustment: 1.5,
maxGasLimit: 25_000_000,
},
extra: {
isValidatorExternalLink: null,
},
},
"mahalo-2": {
tier: "full",
chain: "initia",
registryChainName: "initiadevnet2",
prettyName: "Initia Closed Testnet 2",
Expand Down Expand Up @@ -55,6 +104,7 @@ export const INITIA_CHAIN_CONFIGS: ChainConfigs = {
extra: {},
},
"minimove-2": {
tier: "full",
chain: "initia",
registryChainName: "minitiamovedevnet2",
prettyName: "Minitia Move Closed Testnet 2",
Expand Down Expand Up @@ -102,6 +152,7 @@ export const INITIA_CHAIN_CONFIGS: ChainConfigs = {
},
},
"miniwasm-2": {
tier: "full",
chain: "initia",
registryChainName: "minitiawasmdevnet2",
prettyName: "Minitia Wasm Closed Testnet 2",
Expand Down Expand Up @@ -148,6 +199,7 @@ export const INITIA_CHAIN_CONFIGS: ChainConfigs = {
},
},
"tomcat-1": {
tier: "full",
chain: "initia",
registryChainName: "blackwingdevnet1",
prettyName: "Blackwing Closed Testnet 1",
Expand Down Expand Up @@ -195,6 +247,7 @@ export const INITIA_CHAIN_CONFIGS: ChainConfigs = {
},
},
"stone-13": {
tier: "full",
chain: "initia",
registryChainName: "initiatestnet13",
prettyName: "Initia Testnet 13",
Expand Down
2 changes: 2 additions & 0 deletions src/config/chain/neutron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ChainConfigs } from "./types";

export const NEUTRON_CHAIN_CONFIGS: ChainConfigs = {
"neutron-1": {
tier: "full",
chain: "neutron",
registryChainName: "neutron",
prettyName: "Neutron",
Expand Down Expand Up @@ -49,6 +50,7 @@ export const NEUTRON_CHAIN_CONFIGS: ChainConfigs = {
},
},
"pion-1": {
tier: "full",
chain: "neutron",
registryChainName: "neutrontestnet",
prettyName: "Neutron Testnet",
Expand Down
3 changes: 3 additions & 0 deletions src/config/chain/osmosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ChainConfigs } from "./types";

export const OSMOSIS_CHAIN_CONFIGS: ChainConfigs = {
"osmosis-1": {
tier: "full",
chain: "osmosis",
registryChainName: "osmosis",
prettyName: "Osmosis",
Expand Down Expand Up @@ -53,6 +54,7 @@ export const OSMOSIS_CHAIN_CONFIGS: ChainConfigs = {
},
},
"osmo-test-5": {
tier: "full",
chain: "osmosis",
registryChainName: "osmosistestnet",
prettyName: "Osmosis Testnet",
Expand Down Expand Up @@ -103,6 +105,7 @@ export const OSMOSIS_CHAIN_CONFIGS: ChainConfigs = {
},
},
localosmosis: {
tier: "full",
chain: "osmosis",
registryChainName: "localosmosis",
prettyName: "Local Osmosis",
Expand Down
2 changes: 2 additions & 0 deletions src/config/chain/sei.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { ChainConfigs } from "./types";
*/
export const SEI_CHAIN_CONFIGS: ChainConfigs = {
"pacific-1": {
tier: "full",
chain: "sei",
registryChainName: "sei",
prettyName: "Sei",
Expand Down Expand Up @@ -58,6 +59,7 @@ export const SEI_CHAIN_CONFIGS: ChainConfigs = {
},
},
"atlantic-2": {
tier: "full",
chain: "sei",
registryChainName: "seitestnet2",
prettyName: "Sei Testnet2",
Expand Down
2 changes: 2 additions & 0 deletions src/config/chain/stargaze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ChainConfigs } from "./types";

export const STARGAZE_CHAIN_CONFIGS: ChainConfigs = {
"stargaze-1": {
tier: "full",
chain: "stargaze",
registryChainName: "stargaze",
prettyName: "Stargaze",
Expand Down Expand Up @@ -50,6 +51,7 @@ export const STARGAZE_CHAIN_CONFIGS: ChainConfigs = {
},
},
"elgafar-1": {
tier: "full",
chain: "stargaze",
registryChainName: "stargazetestnet",
prettyName: "Stargaze Testnet",
Expand Down
50 changes: 50 additions & 0 deletions src/config/chain/terra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,56 @@ import { wallets as staionWallets } from "@cosmos-kit/station";
import type { ChainConfigs } from "./types";

export const TERRA_CHAIN_CONFIGS: ChainConfigs = {
"pisco-1-lite": {
tier: "lite",
chain: "terra",
registryChainName: "terra2testnet",
prettyName: "Terra Testnet Lite",
lcd: "https://pisco-lcd.terra.dev:443",
rpc: "https://terra-testnet-rpc.polkachu.com:443",
indexer: "https://pisco-1-graphql.alleslabs.dev/v1/graphql",
wallets: [...staionWallets, ...keplrWallets],
features: {
faucet: {
enabled: false,
},
wasm: {
enabled: true,
storeCodeMaxFileSize: 800_000,
clearAdminGas: 50_000,
},
move: {
enabled: false,
},
pool: {
enabled: false,
},
publicProject: {
enabled: false,
},
gov: {
enabled: true,
version: "v1",
hideOpenProposal: true,
},
nft: {
enabled: false,
},
},
gas: {
gasPrice: {
tokenPerGas: 0.151,
denom: "uluna",
},
gasAdjustment: 1.5,
maxGasLimit: 25_000_000,
},
extra: {
singleStakingDenom: "uluna",
},
},
"phoenix-1": {
tier: "full",
chain: "terra",
registryChainName: "terra2",
prettyName: "Terra",
Expand Down Expand Up @@ -52,6 +101,7 @@ export const TERRA_CHAIN_CONFIGS: ChainConfigs = {
},
},
"pisco-1": {
tier: "full",
chain: "terra",
registryChainName: "terra2testnet",
prettyName: "Terra Testnet",
Expand Down
1 change: 1 addition & 0 deletions src/config/chain/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type GovConfig =
type NftConfig = { enabled: boolean };

export interface ChainConfig {
tier: "lite" | "full";
chain: string;
registryChainName: string;
prettyName: string;
Expand Down
26 changes: 26 additions & 0 deletions src/lib/app-provider/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ import type { ChainConfig } from "config/chain/types";

import { useInternalNavigate } from "./useInternalNavigate";

const TierMap: Record<ChainConfig["tier"], number> = {
lite: 0,
// new metric 1
full: 2,
};

export const useTierConfig = (
{
minTier,
}: {
minTier: ChainConfig["tier"];
} = {
minTier: "lite",
}
) => {
const {
chainConfig: { tier },
} = useCelatoneApp();
const navigate = useInternalNavigate();

if (TierMap[tier] < TierMap[minTier])
navigate({ pathname: "/", replace: true });

return tier;
};

type Features = ChainConfig["features"];

type FeatureVariant = Features[keyof Features];
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/copy/CopyTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const CopyTemplate = ({
onClick={(e) => {
onCopy();
e.stopPropagation();
e.preventDefault();
}}
w={w}
ml={ml}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ export const NftsByCollection = ({
setSearchKeyword("");
}, [collectionAddress, setPageSize, setCurrentPage]);

useEffect(() => setCurrentPage(1), [debouncedSearch, setCurrentPage]);

return (
<Stack spacing="24px" w="full">
<InputWithIcon
placeholder="Search with Token ID"
placeholder="Search with Token ID or NFT VM Address"
value={searchKeyword}
autoFocus
onChange={(e) => setSearchKeyword(e.target.value)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from "@chakra-ui/react";
import { useState } from "react";
import { useEffect, useState } from "react";

import InputWithIcon from "lib/components/InputWithIcon";
import { NftList } from "lib/components/nft";
Expand Down Expand Up @@ -43,10 +43,12 @@ export const CollectionSupplies = ({
debouncedSearch
);

useEffect(() => setCurrentPage(1), [debouncedSearch, setCurrentPage]);

return (
<Box mt="32px" gap="40px">
<InputWithIcon
placeholder="Search with Token ID"
placeholder="Search with Token ID or NFT VM Address"
value={searchKeyword}
autoFocus
onChange={(e) => setSearchKeyword(e.target.value)}
Expand Down
18 changes: 8 additions & 10 deletions src/lib/pages/nft-collection-details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,14 @@ const CollectionDetailsBody = ({
Collection:
</Text>
<Tooltip label="View as Account Address">
<Flex>
<ExplorerLink
value={collectionAddress}
type="user_address"
textFormat="normal"
maxWidth="full"
fixedHeight={false}
ampCopierSection="collection-addresss-top"
/>
</Flex>
<ExplorerLink
value={collectionAddress}
type="contract_address"
textFormat="normal"
maxWidth="full"
fixedHeight={false}
ampCopierSection="collection-addresss-top"
/>
</Tooltip>
</Flex>
<Flex gap={1} align="center">
Expand Down
Loading

0 comments on commit c56b800

Please sign in to comment.