Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0b79037
SDK new structure PoC
alexandratran Sep 23, 2025
44a6248
edits
alexandratran Sep 24, 2025
f234baf
remove custom reference component
alexandratran Sep 24, 2025
f331654
edits
alexandratran Sep 25, 2025
e2f4b8b
Merge branch 'main' into sdk-new-structure
alexandratran Sep 30, 2025
ef20ee1
fix links, update redirects, "metamask wallet sdk"
alexandratran Sep 30, 2025
39b9b16
Merge branch 'main' into sdk-new-structure
alexandratran Oct 16, 2025
905d9a8
add simplified api reference with two examples
alexandratran Oct 18, 2025
549887c
missing files
alexandratran Oct 18, 2025
1b97b2c
Merge branch 'main' into sdk-new-structure
alexandratran Oct 20, 2025
bb103fb
remove starknet docs
alexandratran Oct 21, 2025
8216d8b
copy over solana docs
alexandratran Oct 21, 2025
34aed2c
Merge branch 'main' into sdk-new-structure
alexandratran Oct 22, 2025
d64e8a4
Merge branch 'main' into sdk-new-structure
alexandratran Oct 23, 2025
e02092a
Update terminology and restructure EVM docs
alexandratran Oct 23, 2025
956c09a
fix broken links
alexandratran Oct 23, 2025
86d2dfc
Merge branch 'main' into sdk-new-structure
alexandratran Nov 4, 2025
f70f940
fix broken links
alexandratran Nov 4, 2025
e1e0008
Add/update Solana Wallet Adapter docs (#2443)
alexandratran Nov 7, 2025
37a4d06
Merge branch 'main' into sdk-new-structure
alexandratran Nov 10, 2025
30d0439
Update mobile products menu
alexandratran Nov 10, 2025
3db005f
Update MM Connect EVM JS code samples with potential new usage (#2454)
alexandratran Nov 12, 2025
d122361
Merge branch 'main' into sdk-new-structure
alexandratran Nov 13, 2025
360383d
Remove ParserOpenRPC component and replace usage in Linea services
alexandratran Nov 14, 2025
98476fe
Merge branch 'main' into sdk-new-structure
alexandratran Nov 18, 2025
c04fb6d
fix broken link
alexandratran Nov 18, 2025
b034e01
Add more multichain info (#2479)
alexandratran Nov 18, 2025
77bb9a9
Merge branch 'main' into sdk-new-structure
alexandratran Nov 27, 2025
b4716d6
Enhance JS section {WIP} (#2450)
shahbaz17 Nov 27, 2025
2a6e4ab
Add view & wagmi options
shahbaz17 Nov 27, 2025
6cf2880
Merge branch 'main' into sdk-new-structure
alexandratran Nov 28, 2025
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
Prev Previous commit
Next Next commit
add simplified api reference with two examples
  • Loading branch information
alexandratran committed Oct 18, 2025
commit 905d9a8ffe4162cc197f2c29b005416cfedddfcc
5 changes: 4 additions & 1 deletion sdk-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ const sdkSidebar = {
collapsible: true,
collapsed: true,
link: { type: "doc", id: "evm/connect/reference/json-rpc-api/index" },
items: [],
items: [
"evm/connect/reference/json-rpc-api/wallet_sendCalls",
"evm/connect/reference/json-rpc-api/eth_signTypedData_v4",
],
},
],
},
Expand Down
128 changes: 128 additions & 0 deletions src/components/SimplifiedApiReference/DetailsBox/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import React from 'react'
import Heading from '@theme/Heading'
import ParamField from '../ParamField'
import styles from './styles.module.css'

interface NestedParam {
name: string
type: string
required: boolean
description: string
children?: NestedParam[]
}

interface Parameter {
name: string
type: string
required: boolean
description: string
children?: NestedParam[]
}

interface Error {
code: number | string
message: string
description: string
}

interface Returns {
type: string
description: string
}

interface DetailsBoxProps {
method: string
description?: string
parameters: Parameter[]
returns?: Returns
errors: Error[]
}

const DetailsBox: React.FC<DetailsBoxProps> = ({
method,
description,
parameters,
returns,
errors
}) => {
return (
<>
<Heading as="h1">{method}</Heading>

{description && (
<div className={styles.description}>
<p>{description}</p>
</div>
)}

<Heading as="h2" className={styles.sectionHeading}>
Parameters
</Heading>

<div className={styles.paramContainer}>
{parameters.length === 0 ? (
<div className={styles.noParams}>
This method doesn't accept any parameters.
</div>
) : (
<div className={styles.paramFields}>
{parameters.map((param, index) => (
<ParamField
key={index}
name={param.name}
type={param.type}
required={param.required}
description={param.description}
children={param.children}
expandableTitle={param.children?.length ? `${param.name} properties` : undefined}
/>
))}
</div>
)}
</div>

{returns && (
<>
<Heading as="h2" className={styles.sectionHeading}>
Returns
</Heading>
<div className={styles.paramContainer}>
<div className={styles.returnsInfo}>
<p>{returns.description}</p>
</div>
</div>
</>
)}

{errors.length > 0 && (
<>
<Heading as="h2" className={styles.sectionHeading}>
Errors
</Heading>
<div className={styles.paramContainer}>
<table className={styles.paramTable}>
<thead>
<tr>
<th>Code</th>
<th>Message</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{errors.map((error, index) => (
<tr key={index}>
<td><code>{error.code}</code></td>
<td>{error.message}</td>
<td>{error.description}</td>
</tr>
))}
</tbody>
</table>
</div>
</>
)}
</>
)
}

export default DetailsBox
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.sectionHeading {
padding-top: 1.5rem;
padding-bottom: 1rem;
margin-bottom: 0;
}

.paramContainer {
margin-bottom: 1rem;
}

.paramTable {
margin-top: 1rem !important;
}

.noParams {
padding: 1rem 0;
color: var(--ifm-color-emphasis-700);
font-style: italic;
}

.paramFields {
display: flex;
flex-direction: column;
gap: 0.5rem;
}

.returnsInfo {
padding-bottom: 1rem;
}

.returnsInfo p {
margin: 0.5rem 0;
}

.returnsInfo p:first-child {
margin-top: 0;
}

.returnsInfo p:last-child {
margin-bottom: 0;
}

html[data-theme='dark'] {
.paramTable th {
background: var(--ifm-color-emphasis-200);
}
}
33 changes: 33 additions & 0 deletions src/components/SimplifiedApiReference/Expandable/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useState } from 'react'
import styles from './styles.module.css'

interface ExpandableProps {
title: string
children: React.ReactNode
}

const Expandable: React.FC<ExpandableProps> = ({ title, children }) => {
const [isExpanded, setIsExpanded] = useState(false)

return (
<div className={styles.expandable}>
<button
className={styles.expandableHeader}
onClick={() => setIsExpanded(!isExpanded)}
type="button"
>
<span className={styles.expandableTitle}>{title}</span>
<span className={`${styles.expandableIcon} ${isExpanded ? styles.expanded : ''}`}>
</span>
</button>
{isExpanded && (
<div className={styles.expandableContent}>
{children}
</div>
)}
</div>
)
}

export default Expandable
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.expandable {
border: 1px solid var(--ifm-color-emphasis-200);
border-radius: 0.5rem;
margin: 0.5rem 0;
overflow: hidden;
}

.expandableHeader {
width: 100%;
background: var(--ifm-color-emphasis-100);
border: none;
padding: 1rem;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
text-align: left;
font-size: 1.4rem;
font-weight: 600;
transition: background-color 0.2s ease;
}

.expandableHeader:hover {
background: var(--ifm-color-emphasis-200);
}

.expandableTitle {
color: var(--ifm-color-primary);
}

.expandableIcon {
font-size: 0.8rem;
transition: transform 0.2s ease;
color: var(--ifm-color-emphasis-700);
}

.expandableIcon.expanded {
transform: rotate(180deg);
}

.expandableContent {
padding: 1rem;
background: var(--ifm-color-emphasis-50);
border-top: 1px solid var(--ifm-color-emphasis-200);
}

html[data-theme='dark'] {
.expandableHeader {
background: var(--ifm-color-emphasis-200);
}

.expandableHeader:hover {
background: var(--ifm-color-emphasis-300);
}
}
69 changes: 69 additions & 0 deletions src/components/SimplifiedApiReference/ParamField/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from 'react'
import Expandable from '../Expandable'
import styles from './styles.module.css'

interface NestedParam {
name: string
type: string
required: boolean
description: string
children?: NestedParam[]
}

interface ParamFieldProps {
name: string
type: string
required: boolean
description: string
children?: NestedParam[]
expandableTitle?: string
}

const ParamField: React.FC<ParamFieldProps> = ({
name,
type,
required,
description,
children = [],
expandableTitle
}) => {
const hasChildren = children.length > 0

const renderNestedParams = (params: NestedParam[], title?: string) => {
if (params.length === 0) return null

return (
<Expandable title={title || `${name} properties`}>
{params.map((param, index) => (
<ParamField
key={index}
name={param.name}
type={param.type}
required={param.required}
description={param.description}
children={param.children}
expandableTitle={param.children?.length ? `${param.name} properties` : undefined}
/>
))}
</Expandable>
)
}

return (
<div className={styles.paramField}>
<div className={styles.paramHeader}>
<div className={styles.paramName}>
<code>{name}</code>
<span className={styles.paramType}>({type})</span>
{required && <span className={styles.required}>required</span>}
</div>
</div>
<div className={styles.paramDescription}>
{description}
</div>
{hasChildren && renderNestedParams(children, expandableTitle)}
</div>
)
}

export default ParamField
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.paramField {
margin-bottom: 1rem;
padding-top: 1rem;
}

.paramHeader {
margin-bottom: 0.5rem;
}

.paramName {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
}

.paramName code {
font-family: var(--font-mm-sans-mono);
font-size: 1.3rem;
}

.paramType {
color: var(--ifm-color-emphasis-700);
font-size: 1.4rem;
font-style: italic;
}

.required {
background: var(--ifm-color-primary);
color: white;
padding: 0rem 0.3rem;
border-radius: 0.25rem;
font-size: 1.2rem;
font-weight: 500;
}

.paramDescription {
font-size: 1.6rem;
}

html[data-theme='dark'] {
.required {
color: black;
font-weight: 400;
}
}
Loading
Loading