Skip to content

Commit

Permalink
Clean up unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
besated committed Sep 20, 2024
1 parent 685780f commit c46c90b
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 4,106 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.18.0
v20.17.0
21 changes: 11 additions & 10 deletions components/APIEndpoint/APIEndpoint.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Code, Flex, Paper, Title, Accordion, Breadcrumbs, Anchor, Text } from '@mantine/core';
import { CodeHighlight } from '@mantine/code-highlight';
import { EndpointResponseProperty, EndpointParameter, Endpoint } from './types';
import { StyledSyntaxHighlighter } from '../StyledSyntaxHighlighter';

const renderProperties = (properties: EndpointResponseProperty) => {
return Object.entries(properties).map(([key, value]) => (
Expand Down Expand Up @@ -123,6 +123,15 @@ export const APIEndpoint = ({ endpoint }: { endpoint: Endpoint }) => {
.reduce((acc, curr) => ({ ...acc, [curr]: '' }), {})
);

const exampleCode = `
import { getQueryClient } from '@sei-js/cosmjs';
const queryClient = await getQueryClient("YOUR_RPC_URL");
const { ${routeNames.functionName} } = queryClient.${orgName}.${moduleName}.${version};
const params: ${requestType} = ${paramsString};
const response: ${responseType} = await ${routeNames.functionName}(params);`;

return (
<Flex direction='column' gap='xl'>
<Breadcrumbs mt='md'>
Expand Down Expand Up @@ -164,15 +173,7 @@ export const APIEndpoint = ({ endpoint }: { endpoint: Endpoint }) => {
</Flex>
<Flex gap='sm' direction='column'>
<Title order={4}>Example Usage</Title>
<StyledSyntaxHighlighter language='javascript'>
{`import { getQueryClient } from '@sei-js/cosmjs';
const queryClient = await getQueryClient("YOUR_RPC_URL");
const { ${routeNames.functionName} } = queryClient.${orgName}.${moduleName}.${version};
const params: ${requestType} = ${paramsString};
const response: ${responseType} = await ${routeNames.functionName}(params);`}
</StyledSyntaxHighlighter>
<CodeHighlight language='js' code={exampleCode} />
</Flex>
</Flex>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type PropertyInfoProps = {
properties?: { name: string; description: string }[];
};

export const PropertyInfo = ({ name, description, properties }: PropertyInfoProps) => {
const PropertyInfo = ({ name, description, properties }: PropertyInfoProps) => {
return (
<Flex direction='column' mt='md'>
<Text style={{ fontSize: '14pt', fontWeight: 600 }}>{name}</Text>
Expand All @@ -28,3 +28,5 @@ export const PropertyInfo = ({ name, description, properties }: PropertyInfoProp
</Flex>
);
};

export default PropertyInfo;
1 change: 1 addition & 0 deletions components/PropertyInfo/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as PropertyInfo } from './PropertyInfo';
13 changes: 0 additions & 13 deletions components/StyledSyntaxHighlighter/index.tsx

This file was deleted.

1 change: 1 addition & 0 deletions components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export * from './Logo';
export * from './MantineWrapper';
export * from './Nfts';
export * from './VersionFetcher';
export * from './PropertyInfo';
export * from './EcosystemMap';
15 changes: 4 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,18 @@
},
"license": "MIT",
"dependencies": {
"@mantine/code-highlight": "^7.12.2",
"@mantine/core": "^7.10.1",
"@mantine/hooks": "^7.10.1",
"@mdx-js/loader": "^3.0.1",
"@next/mdx": "^14.2.3",
"@rainbow-me/rainbowkit": "^1.3.3",
"@sei-js/cosmjs": "^1.0.7",
"@sei-js/evm": "^1.1.1",
"@sei-js/registry": "^1.0.1",
"@tabler/icons-react": "^3.5.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/styled-components": "^5.1.34",
"lucide-react": "^0.314.0",
"next": "13.0.6",
"next-compose-plugins": "^2.2.1",
"next-seo": "^6.5.0",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-syntax-highlighter": "^15.5.0",
"sharp": "^0.33.5",
"styled-components": "^6.1.11",
"tailwind-merge": "^2.2.1",
"underscore": "^1.13.6",
Expand All @@ -41,6 +31,9 @@
},
"devDependencies": {
"@types/node": "18.11.10",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/styled-components": "^5.1.34",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.38",
"postcss-preset-mantine": "^1.15.0",
Expand Down
7 changes: 4 additions & 3 deletions pages/_app.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import '@rainbow-me/rainbowkit/styles.css';
import '@mantine/core/styles.css';
import '@mantine/code-highlight/styles.css';
import '../styles/globals.css';
import '../styles/custom.css';
import '@rainbow-me/rainbowkit/styles.css';
import { ThemeProvider } from 'next-themes';
import '@mantine/core/styles.css';
import { MantineWrapper } from '../components/MantineWrapper';
import { MantineWrapper } from '../components';

export default function Nextra({ Component, pageProps }) {
return (
Expand Down
7 changes: 4 additions & 3 deletions pages/dev-smart-contracts.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Blockquote, List, Paper, Text, Title } from '@mantine/core';
import { IconInfoCircle } from '@tabler/icons-react';
import { Callout } from 'nextra/components'
import { Callout } from 'nextra/components';

# Smart Contracts

Expand Down Expand Up @@ -43,7 +42,6 @@ The EVM is a decentralized computation engine that allows the execution of smart
- Developers with a background in Ethereum development.
- Applications benefiting from Ethereum’s mature tooling and ecosystem.


The EVM is a decentralized computation engine that allows the execution of smart contracts on Ethereum and EVM-compatible blockchains. EVM contracts are typically written in Solidity, a language designed for Ethereum.

- **MetaMask**: Popular Ethereum wallet.
Expand All @@ -58,6 +56,7 @@ The EVM is a decentralized computation engine that allows the execution of smart
- [Wagmi Documentation](https://wagmi.sh/)
- **Viem**: A lightweight and flexible library for Ethereum development.
- [Viem Documentation](https://viem.sh/)

</Paper>

### CosmWasm
Expand Down Expand Up @@ -96,6 +95,7 @@ CosmWasm is a smart contract platform built for the Cosmos ecosystem, enabling c
- **[CosmosKit](https://github.com/cosmology-tech/cosmos-kit)**: Library for connecting to Cosmos wallets.
- **[@sei-js](https://github.com/sei-protocol/sei-js)**: Typescript library for interacting with Sei.
- **[CosmJS](https://cosmos.github.io/cosmjs/)**: JavaScript library for interacting with Cosmos blockchains.

</Paper>

<Callout type="info" emoji="ℹ️">
Expand All @@ -104,6 +104,7 @@ CosmWasm is a smart contract platform built for the Cosmos ecosystem, enabling c

- **EVM Precompile Contracts**: Precompiles are smart contracts pre-bundled into the chain. Sei has many precompiles to enable EVM dApps and contracts to access native Cosmos functions, such as staking and executing CosmWasm contracts.
- **Pointer Contracts**: These contracts act as intermediaries, enabling calls between EVM and CosmWasm contracts. This allows developers to leverage the strengths of both environments and create more versatile dApps.

</Callout>

## Best Practices
Expand Down
48 changes: 23 additions & 25 deletions pages/dev-transactions.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Flex, Paper } from '@mantine/core';
import { Tabs } from 'nextra/components';
import { PropertyInfo } from '../components/PropertyInfo';
import { atomOneDark, atomOneLight } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { StyledSyntaxHighlighter } from '../components/StyledSyntaxHighlighter';
import { CodeHighlight } from '@mantine/code-highlight';
import { PropertyInfo } from '../components';

# Transactions

Expand All @@ -19,8 +17,9 @@ Cosmos transactions are used for interacting with Cosmos based RPC's and tooling

<Tabs items={['JSON Example', 'Properties']}>
<Tabs.Tab>
<StyledSyntaxHighlighter language='json'>
{`
<CodeHighlight
language='json'
code={`
{
"body": {
"messages": [
Expand Down Expand Up @@ -64,9 +63,8 @@ Cosmos transactions are used for interacting with Cosmos based RPC's and tooling
}
},
"signatures": ["SIGNER_SIGNATURE_VALUE"]
}
`}
</StyledSyntaxHighlighter>
}`}
/>
</Tabs.Tab>
<Tabs.Tab>
<Flex direction='column' gap='md'>
Expand Down Expand Up @@ -111,27 +109,27 @@ The Sei blockchain supports Ethereum Virtual Machine (EVM) transactions, allowin

<Tabs items={['JSON Example', 'Properties']}>
<Tabs.Tab>
<StyledSyntaxHighlighter language='json'>
{`
{
<CodeHighlight
language='json'
code={`
{
id: 2,
jsonrpc: '2.0',
method: 'account_signTransaction',
params: [
{
from: '0x1923f626bb8dc025849e00f99c25fe2b2f7fb0db',
gas: '0x55555',
maxFeePerGas: '0x1234',
maxPriorityFeePerGas: '0x1234',
input: '0xabcd',
nonce: '0x0',
to: '0x07a565b7ed7d7a678680a4c162885bedbb695fe0',
value: '0x1234'
}
{
from: '0x1923f626bb8dc025849e00f99c25fe2b2f7fb0db',
gas: '0x55555',
maxFeePerGas: '0x1234',
maxPriorityFeePerGas: '0x1234',
input: '0xabcd',
nonce: '0x0',
to: '0x07a565b7ed7d7a678680a4c162885bedbb695fe0',
value: '0x1234'
}
]
}
`}
</StyledSyntaxHighlighter>
}`}
/>
</Tabs.Tab>
<Tabs.Tab>
<Paper withBorder p='md' mt='lg'>
Expand Down
6 changes: 0 additions & 6 deletions utils/index.ts

This file was deleted.

Loading

0 comments on commit c46c90b

Please sign in to comment.