Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: updated #513

Merged
merged 1 commit into from
Jun 11, 2024
Merged
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
39 changes: 0 additions & 39 deletions site/docs/pages/frame/introduction.mdx

This file was deleted.

10 changes: 0 additions & 10 deletions site/docs/pages/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,3 @@ import '@coinbase/onchainkit/styles.css';
```

::::

OnchainKit is divided into various theme utilities and components that are available for your use:

- [Frame](/frame/introduction)
- [Identity](/identity/introduction)
- [Swap](/swap/introduction)
- [Token](/token/introduction)
- [Wallet](/wallet/introduction)
- [Farcaster](/farcaster/introduction)
- [XMTP](/xmtp/introduction)
12 changes: 0 additions & 12 deletions site/docs/pages/swap/introduction.mdx

This file was deleted.

4 changes: 3 additions & 1 deletion site/docs/pages/swap/swap-amount-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import SwapAmountInputContainer from '../../components/SwapAmountInputContainer.

# `<SwapAmountInput />`

The `SwapAmountInput` component is a stylized input field designed for users to specify the amount of a particular token they wish to swap. This component integrates the `TokenSelector` component to allow users to select different tokens.
The `SwapAmountInput` component is a stylized input field designed for users to specify the amount of a particular token they wish to swap.

This component integrates the `TokenSelector` component to allow users to select different tokens.

## Usage

Expand Down
40 changes: 40 additions & 0 deletions site/docs/pages/token/token-select-dropdown.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{/* import { TokenSelectDropdown } from '../../../../src/token'; */}
import { TokenSelectDropdown } from '@coinbase/onchainkit/token';
import TokenSelectorContainer from '../../components/TokenSelectorContainer.tsx';
import App from '../App';

Expand Down Expand Up @@ -142,6 +143,45 @@ The `TokenSelectDropdown` component is a dropdown component that selects a token

:::

<App>
<TokenSelectorContainer>
{(token, setToken) => (
<TokenSelectDropdown
token={token}
setToken={setToken}
options={[
{
name: 'Ethereum',
address: '',
symbol: 'ETH',
decimals: 18,
image: 'https://wallet-api-production.s3.amazonaws.com/uploads/tokens/eth_288.png',
chainId: 8453,
},
{
name: 'USDC',
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
symbol: 'USDC',
decimals: 6,
image:
'https://d3r81g40ycuhqg.cloudfront.net/wallet/wais/44/2b/442b80bd16af0c0d9b22e03a16753823fe826e5bfd457292b55fa0ba8c1ba213-ZWUzYjJmZGUtMDYxNy00NDcyLTg0NjQtMWI4OGEwYjBiODE2',
chainId: 8453,
},
{
name: 'Dai',
address: '0x50c5725949a6f0c72e6c4a641f24049a917db0cb',
symbol: 'DAI',
decimals: 18,
image:
'https://d3r81g40ycuhqg.cloudfront.net/wallet/wais/d0/d7/d0d7784975771dbbac9a22c8c0c12928cc6f658cbcf2bbbf7c909f0fa2426dec-NmU4ZWViMDItOTQyYy00Yjk5LTkzODUtNGJlZmJiMTUxOTgy',
chainId: 8453,
},
]}
/>
)}
</TokenSelectorContainer>
</App>

## Props

[`TokenSelectDropdownReact`](/token/types#tokenselectdropdownreact)
Expand Down
8 changes: 1 addition & 7 deletions site/docs/pages/wallet/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ const wagmiConfig = createConfig({
});

function App({ children }: { children: ReactNode }) {
return (
<WagmiProvider config={wagmiConfig}>
{' '}
// [!code focus]
{children}
</WagmiProvider> // [!code focus]
);
return <WagmiProvider config={wagmiConfig}>{children}</WagmiProvider>;
}
```
3 changes: 1 addition & 2 deletions site/docs/pages/wallet/is-wallet-a-smart-wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `isWalletASmartWallet` utility is designed to verify if a given sender addre
:::code-group

```tsx [code]
import { isWalletASmartWallet } from '@coinbase/onchainkit/wallet'; // [!code focus]
import { isWalletASmartWallet } from '@coinbase/onchainkit/wallet';
import { http } from 'viem';
import { baseSepolia } from 'viem/chains';
import type { UserOperation } from 'permissionless';
Expand All @@ -21,7 +21,6 @@ export const publicClient = createPublicClient({
const userOperation = { sender: '0x123' } as UserOperation<'v0.6'>;

if (isWalletASmartWallet({ client: publicClient, userOp: userOperation })) {
// [!code focus]
console.log('The sender address is a valid smart wallet proxy.');
} else {
console.log('The sender address is not a valid smart wallet proxy.');
Expand Down
13 changes: 2 additions & 11 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,18 @@
"preview": "vocs preview"
},
"dependencies": {
"@coinbase/onchainkit": "0.19.6",
"@coinbase/wallet-sdk": "^4.0.0",
"@coinbase/onchainkit": "0.20.0",
"@tanstack/react-query": "^5.36.0",
"@types/react": "latest",
"clsx": "^2.1.1",
"graphql": "14",
"graphql-request": "6",
"permissionless": "^0.1.29",
"react": "18",
"react-dom": "18",
"react-farcaster-embed": "^1.4.7",
"tailwind-merge": "^2.3.0",
"tailwindcss": "^3.4.1",
"tar": "^7.0.0",
"typescript": "latest",
"viem": "^2.10.9",
"vite": "^5.2.8",
"vocs": "1.0.0-alpha.52",
"wagmi": "^2.9.2"
},
"resolutions": {
"@coinbase/wallet-sdk": "npm:@coinbase/[email protected]"
"vocs": "1.0.0-alpha.52"
}
}
2 changes: 0 additions & 2 deletions site/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const sidebar = [
{
text: 'Frame',
items: [
{ text: 'Introduction', link: '/frame/introduction' },
{
text: 'Components',
items: [
Expand Down Expand Up @@ -139,7 +138,6 @@ export const sidebar = [
{
text: 'Swap',
items: [
{ text: 'Introduction', link: '/swap/introduction' },
{
text: 'Components',
items: [
Expand Down
Loading
Loading