Skip to content

docs(drift): draft from relayprotocol/relay-kit#983#304

Merged
pedromcunha merged 8 commits into
mainfrom
docs-drift/relayprotocol-relay-kit-pr-983-d3d6fe2
Apr 24, 2026
Merged

docs(drift): draft from relayprotocol/relay-kit#983#304
pedromcunha merged 8 commits into
mainfrom
docs-drift/relayprotocol-relay-kit-pr-983-d3d6fe2

Conversation

@pedromcunha
Copy link
Copy Markdown
Member

Drafted from relayprotocol/relay-kit#983, requested by @pedromcunha.

This PR was auto-generated by the docs-draft-pr workflow from a Claude-drafted update in the source repo. It is opened as a draft — please review, edit as needed, and mark ready for review before merging.

Review checklist

  • Content matches the behavior shipped in the source PR
  • No internal-only details (service names, file paths, unreleased names, security internals) leaked into the draft
  • Conforms to CLAUDE.md style rules
  • Cross-references and internal links resolve
  • Any Needs human input items from the source comment are addressed

Generated by docs-draft-pr.yml in relayprotocol/relay-kit.

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 23, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
unevenlabs 🟢 Ready View Preview Apr 23, 2026, 11:03 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@pedromcunha pedromcunha marked this pull request as ready for review April 24, 2026 01:14
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude finished @pedromcunha's task in 2m 8s —— View job


Code Review

Reviewed both files against CLAUDE.md. The PR adds Lighter SDK adapter content in the expected two places and mostly follows the existing patterns. A few issues — one content bug, one likely package-name typo, a couple of style nits, and some pre-existing drift worth cleaning up while this page is open.


🔴 Content bug — contradictory intro

references/api/api_guides/lighter-support.mdx:6

Relay supports depositing and withdrawing to Lighter from any supported chain. To try it today, deposit using the [Relay App](https://relay.link/bridge/lighter) (withdrawing is not yet supported).

The first sentence promises withdrawal support; the second sentence takes it back. This is more confusing than the original <Note> it replaced. The frontmatter description ("How to deposit to Lighter from any Relay chain") also no longer matches.

Suggest either reverting to the prior "deposit only + <Note>" shape, or rephrasing cleanly:

Relay supports depositing to Lighter from any supported chain (withdrawal support is coming soon). To try it today, use the [Relay App](https://relay.link/bridge/lighter). This document details how to integrate Lighter deposits into your application.

Fix this →


🟠 Likely typo — package namespace

references/api/api_guides/lighter-support.mdx:81

yarn add @relay-protocol/lighter-ts-sdk

Every other Relay package on this page (and across the docs) uses the @relayprotocol/ namespace — no hyphen. @relay-protocol/lighter-ts-sdk (with a hyphen) is inconsistent with @relayprotocol/relay-lighter-wallet-adapter on the line just above. Please double-check the actual published package name; if this is the Lighter team's own SDK it may live under a different org entirely (e.g. @elliottech/...).


🟠 Code example likely breaks at runtime

references/relay-kit/sdk/adapters.mdx:257-267 (the new Lighter tab)

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})
const account = walletClient.account!

When createWalletClient is constructed with a custom transport and no account option, walletClient.account is undefined. The ! satisfies TypeScript but the subsequent walletClient.signMessage({ account, message }) will throw at runtime. Integrators typically need const [address] = await walletClient.requestAddresses() first. Suggested shape:

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})
const [address] = await walletClient.requestAddresses()

const adaptedWallet = adaptLighterWallet({
  l1Address: address,
  signL1Message: (message) =>
    walletClient.signMessage({ account: address, message })
})

(The pre-existing Viem tab on L88–91 has the same latent issue, but it doesn't call account afterward so it's less visible. Not in scope to fix here.)


🟡 Style nits

  • Missing language on code fencesreferences/api/api_guides/lighter-support.mdx:74 and :80 use bare ``` fences. Per §2.8, tag them bash.
  • Consider <CodeGroup> instead of a separate ## SDK section — §2.8 says "Feature guide examples use <CodeGroup> with at least SDK and API variants." Today the page has curl-only throughout and then a tail ## SDK install section. The current shape is acceptable (and low-churn), but restructuring the ## Example Quote Request block into a <CodeGroup> with SDK + API tabs would be more on-pattern. Judgment call — fine to leave for a follow-up.
  • Hard line breaks inside sentencesreferences/api/api_guides/lighter-support.mdx:71-72 and :84-85 split a sentence across two lines. Renders fine, just inconsistent with the rest of the file. Minor.

🔵 Pre-existing drift worth cleaning up

Not introduced by this PR, but visible while the file is open:

  • references/api/api_guides/lighter-support.mdx:8 and :12 use # Prerequisites and # API Access (H1 in body). Per §2.2, the frontmatter title is the H1 — body headings start at ##. Safe to downgrade in this PR.

Checklist

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references (anchor #what-adapters-are-available-out-of-the-box resolves to ### What adapters are available out of the box? — good)
  • Post review
    · Branch

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude finished @pedromcunha's task in 2m 48s —— View job


Code Review

Re-reviewed after the two follow-up commits. The withdrawal flow (## How to withdraw section + data.action table) is a nice addition and the parameter table now cleanly distinguishes deposits vs withdrawals. A few of the previously-flagged issues are still unresolved, and the scope expansion (adding withdrawals) has created new drift in the intro/frontmatter.


🔴 Previously flagged — still unresolved

1. Runtime bug in Lighter code example references/relay-kit/sdk/adapters.mdx:261

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})
const account = walletClient.account!

walletClient.account is undefined when createWalletClient is constructed without an explicit account. The ! only suppresses the TypeScript error — at runtime the subsequent walletClient.signMessage({ account, message }) will throw. Integrators need requestAddresses() (or similar) first. Suggested shape:

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!)
})
const [address] = await walletClient.requestAddresses()

const adaptedWallet = adaptLighterWallet({
  l1Address: address,
  signL1Message: (message) =>
    walletClient.signMessage({ account: address, message })
})

Fix this →

2. Likely typo — package namespace references/api/api_guides/lighter-support.mdx:887

yarn add @relay-protocol/lighter-ts-sdk

Still inconsistent with @relayprotocol/relay-lighter-wallet-adapter on line 881 (no hyphen). Please confirm the actual published name — the Lighter team's SDK may live under a different org entirely (e.g. @elliott-tech/... given the zklighter.elliot.ai API host). If the real package is @elliot-labs/lighter-ts-sdk or similar, the doc should show that exact scope.

3. Missing language tag on code fences references/api/api_guides/lighter-support.mdx:880, :886

yarn add @relayprotocol/relay-lighter-wallet-adapter @relayprotocol/relay-sdk viem

Both fences are bare ```. Per §2.8, tag them bash.

4. H1 in body — pre-existing drift still in place references/api/api_guides/lighter-support.mdx:8, :12

# Prerequisites
...
# API Access

Per §2.2, the frontmatter title is the H1. Body headings start at ##. The rest of the file already uses ## (e.g. ## Lighter-Specific API Parameters, ## How to deposit), so these two are the outliers. Safe to downgrade in this PR.


🟠 New issues introduced by this revision

5. Frontmatter description is now stale references/api/api_guides/lighter-support.mdx:3

description: "How to deposit to Lighter from any Relay chain"

The page now documents both deposits and withdrawals (## How to withdraw section, withdrawal-specific user parameter, data.action table). Suggest:

description: "How to deposit to and withdraw from Lighter using the Relay API"

6. Intro paragraph stale in the same way references/api/api_guides/lighter-support.mdx:6

The intro ends with "This document details how to integrate Lighter deposits into your application." — but the doc now also walks through withdrawals. Broaden to "…how to integrate Lighter deposits and withdrawals into your application."

7. Internal links use absolute URLs references/api/api_guides/lighter-support.mdx:14, :444

[execution steps](https://docs.relay.link/references/api/api_core_concepts/step-execution)
[Get Quote](https://docs.relay.link/references/api/get-quote-v2)

Per §2.6, internal links must be root-relative: /references/api/api_core_concepts/step-execution, /references/api/get-quote-v2. The <Tip> on line 17 and the SDK link on line 878 already follow this convention — these two are the outliers.

Fix this →


🟡 Style nits

  • Casing: "Lighter-specific"references/api/api_guides/lighter-support.mdx:839 reads "lighter specific execution data". Should be "Lighter-specific" (proper noun + hyphenated compound modifier).
  • Parameter table row with slashreferences/api/api_guides/lighter-support.mdx:24 combines **toChainId** / **fromChainId** into one row. Works, but two separate rows would scan more cleanly and match the rest of the repo's convention. Judgment call.
  • Hard line breaks inside sentencesreferences/api/api_guides/lighter-support.mdx:877-878 and :890-891 still split a sentence across two lines. Renders fine, just inconsistent with the rest of the file.

✅ Resolved from prior review

  • Intro no longer self-contradicts — the qualifier "not yet supported in the app" fixes the worst of the confusion (the description/intro still need widening to match the new scope — see Add deep linking guide #5/Fix typos #6).
  • Parameter table now distinguishes deposit vs withdrawal parameters.

Checklist

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references
  • Post review
    · Branch

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude finished @pedromcunha's task in 1m 42s —— View job


Code Review

Re-reviewed after commit f66988b. Several issues are fixed (frontmatter description, intro paragraph, code-fence language tags, requestAddresses() call). But the requestAddresses() fix introduced a new runtime bug, and three of the previously-flagged issues are still outstanding.


🔴 New bug — undefined reference in Lighter code example

references/relay-kit/sdk/adapters.mdx:262-268

const [address] = await walletClient.requestAddresses()

const adaptedWallet = adaptLighterWallet({
  l1Address: address,
  signL1Message: (message) =>
    walletClient.signMessage({ account, message })
})

The fix renamed the variable from accountaddress, but the signMessage call on line 267 still references the old name account (which no longer exists). This is a straight ReferenceError at runtime. Should be:

signL1Message: (message) =>
  walletClient.signMessage({ account: address, message })

Fix this →


🔴 Still unresolved — package namespace typo

references/api/api_guides/lighter-support.mdx:887

yarn add @relay-protocol/lighter-ts-sdk

Still inconsistent with @relayprotocol/relay-lighter-wallet-adapter on line 881 (no hyphen). Please confirm the actual published scope — the Lighter team's SDK likely lives under a different org entirely (the API host is zklighter.elliot.ai, suggesting something like @elliot-labs/...). Either way, the doc needs the real scope, and @relay-protocol/... is almost certainly wrong.


🔴 Still unresolved — internal links use absolute URLs

references/api/api_guides/lighter-support.mdx:14, :444

[execution steps](https://docs.relay.link/references/api/api_core_concepts/step-execution)
[Get Quote](https://docs.relay.link/references/api/get-quote-v2)

Per §2.6, internal links must be root-relative. Should be /references/api/api_core_concepts/step-execution and /references/api/get-quote-v2. The <Tip> on line 17 and the SDK link on line 878 already follow the convention — these two are the outliers.

Fix this →


🟠 Still unresolved — H1 in body

references/api/api_guides/lighter-support.mdx:8, :12

# Prerequisites
...
# API Access

Per §2.2, the frontmatter title is the H1 — body headings start at ##. The rest of the file already uses ## (e.g. ## Lighter-Specific API Parameters, ## How to deposit, ## How to withdraw, ## SDK). These two are the only outliers.

Fix this →


🟡 Style nits

  • Casing: "Lighter-specific"references/api/api_guides/lighter-support.mdx:839 reads "The quote api returns a transaction step with lighter-specific execution data". Should be "Lighter-specific" (proper noun + hyphenated compound modifier). Also "quote api""Quote API" on the same line.
  • "deposits"-only copy in ## API Accessreferences/api/api_guides/lighter-support.mdx:14 still says "When you're ready to execute deposits, refer to the [Get Quote] API endpoint." Now that the doc also covers withdrawals, broaden to "execute deposits or withdrawals".
  • Parameter table row with slashreferences/api/api_guides/lighter-support.mdx:24 still combines **toChainId** / **fromChainId** into one row. Works, but two rows would scan more cleanly. Judgment call.
  • Hard line breaks inside sentencesreferences/api/api_guides/lighter-support.mdx:877-878 and :890-891 still split a sentence across two lines. Renders fine, just inconsistent.

✅ Resolved from prior review

  • Frontmatter description broadened to cover both deposits and withdrawals (line 3).
  • Intro paragraph no longer self-contradicts and no longer only mentions deposits (line 6).
  • Code-fence language tags added (bash on lines 880, 886).
  • walletClient.account! replaced with await walletClient.requestAddresses()but the rename is incomplete, see the new bug above.

Checklist

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references
  • Post review
    · Branch

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude finished @pedromcunha's task in 2m 50s —— View job


Code Review

Re-reviewed after commit f282ed2. The signMessage({ account: address, message }) fix is correctly applied now — the runtime bug is resolved. Several of the previously-flagged issues from the three prior reviews are still outstanding, and the hyperliquid-support.mdx edit introduces a partial fix that leaves one absolute URL in place.


🔴 Still unresolved — package namespace typo (flagged 3× now)

references/api/api_guides/lighter-support.mdx:887

yarn add @relay-protocol/lighter-ts-sdk

Still inconsistent with @relayprotocol/relay-lighter-wallet-adapter on line 881 (no hyphen). This has been flagged in every prior review and never addressed. Please confirm the actual published scope — the Lighter team's SDK likely lives under a different org entirely (the API host is zklighter.elliot.ai, suggesting something like @elliot-labs/...). Either way, @relay-protocol/... with a hyphen is almost certainly wrong. If this is the real name, please leave a reply confirming — otherwise the doc will mislead integrators.


🔴 Still unresolved — absolute internal link

references/api/api_guides/lighter-support.mdx:444

[step execution](https://docs.relay.link/references/api/api_core_concepts/step-execution)

Per §2.6, internal links must be root-relative. Line 14 was fixed in this revision; line 444 was missed. Should be /references/api/api_core_concepts/step-execution.

Fix this →


🔵 New regression in this PR — hyperliquid-support.mdx only partially fixed

references/api/api_guides/hyperliquid-support.mdx:10

Hyperliquid can be accessed using the standard Relay API flow. To get started, review the [**execution steps**](/references/api/api_core_concepts/step-execution) documentation. When you're ready to execute swaps, refer to the [**Get Quote**](https://docs.relay.link/references/api/get-quote-v2) API endpoint.

This PR converted the first link on line 10 and the Chains API link on line 31 to root-relative paths, but left the Get Quote link (same line, same sentence) absolute. Finish the cleanup for consistency: [**Get Quote**](/references/api/get-quote-v2).

Fix this →


🟠 Still unresolved — H1 in body

references/api/api_guides/lighter-support.mdx:8

# Prerequisites

Per §2.2, the frontmatter title is the H1 — body headings start at ##. ## API Access on line 12 was correctly downgraded in this revision; # Prerequisites on line 8 was missed. Every other heading in the file already uses ##, so this is the only outlier.

(Note: hyperliquid-support.mdx has the same drift on lines 8 and 33 — pre-existing, not introduced by this PR, so fine to leave for a separate cleanup.)

Fix this →


🟡 Style nits

  • Capitalization on line 839 and 873references/api/api_guides/lighter-support.mdx:839 reads "The quote api returns a transaction step with lighter-specific execution data". Should be "The Quote API returns a transaction step with Lighter-specific execution data" (proper noun + hyphenated compound modifier; API is all-caps per §5). Same "quote api""Quote API" fix applies to line 873.
  • Frontmatter description reads awkwardlyreferences/api/api_guides/lighter-support.mdx:3 now says "How to deposit to and withdraw from Lighter to any Relay chain". The trailing "to any Relay chain" only cleanly applies to the deposit direction. Suggest "How to deposit to and withdraw from Lighter using the Relay API".
  • Parameter table row with slashreferences/api/api_guides/lighter-support.mdx:24 still combines **toChainId** / **fromChainId** into one row. Works, but two rows would scan more cleanly. Judgment call.
  • Hard line breaks inside sentencesreferences/api/api_guides/lighter-support.mdx:877-878 and :890-891 still split a sentence across two lines. Renders fine, just inconsistent.

✅ Resolved from prior review

  • Runtime bug in Lighter adapter snippet — signMessage now correctly references address (references/relay-kit/sdk/adapters.mdx:267).
  • Line 14 Get Quote link switched to root-relative.
  • Line 12 # API Access## API Access.
  • Hyperliquid Chains API link converted to root-relative (line 31) and execution steps link on line 10.

Checklist

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references
  • Post review
    · Branch

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude encountered an error —— View job


Code Review in progress

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references
  • Post review
    · Branch

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude encountered an error —— View job


Code Review

Re-reviewed after commit f9fadc0. Good progress — the Quote API / Lighter-specific casing is fixed, the line 444 link is now root-relative, ## Prerequisites downgraded to ##, the hyperliquid Get Quote link is root-relative, and the adapter snippet's runtime bug is still resolved. One blocker remains unresolved across four reviews.


🔴 Still unresolved — package namespace typo (flagged 4× now)

references/api/api_guides/lighter-support.mdx:887

yarn add @relay-protocol/lighter-ts-sdk

Every other Relay package across this repo uses the @relayprotocol/ scope — no hyphen (e.g. line 881: @relayprotocol/relay-lighter-wallet-adapter @relayprotocol/relay-sdk). This has been flagged in every prior review and is still inconsistent. Two possibilities:

  1. It's a typo — should be @relayprotocol/lighter-ts-sdk to match the scope on line 881.
  2. It's a third-party SDK — given the API host is zklighter.elliot.ai, the Lighter team's published package likely lives under a different org entirely (e.g. @elliot-labs/...). If so, the doc should show that exact scope, not something under a "relay" org at all.

Either way, @relay-protocol/... (with the hyphen) is almost certainly wrong and will break for integrators who copy-paste. Please either confirm the real published name or fix it.

Fix this →


🟠 Pre-existing drift worth cleaning up (not introduced by this PR)

references/api/api_guides/hyperliquid-support.mdx:8 still has # API Access (H1 in body). Per §2.2, the frontmatter title is the H1 — body headings start at ##. The companion lighter-support.mdx has already been fully cleaned up in this PR; safe to do the same here in one line. (# Withdrawals on line 33 is already correctly ## Withdrawals from Hyperliquid — only line 8 is the outlier.)

Fix this →


🟡 Style nits (unchanged from prior review — low-priority)

  • Parameter table row with slashreferences/api/api_guides/lighter-support.mdx:24 still combines **toChainId** / **fromChainId** into one row. Works, but two rows would scan more cleanly and match the repo's convention. Judgment call.
  • Hard line breaks inside sentencesreferences/api/api_guides/lighter-support.mdx:877-878 and :890-891 still split a sentence across two lines. Renders fine, just inconsistent with the rest of the file. Minor.

✅ Resolved in this revision

  • Absolute URL on line 444 converted to root-relative /references/api/api_core_concepts/step-execution.
  • # Prerequisites on line 8 downgraded to ## Prerequisites.
  • quote apiQuote API (lines 839, 873).
  • lighter-specificLighter-specific (line 839).
  • Hyperliquid Get Quote link (line 10) converted to root-relative.
  • Frontmatter description rephrased to "How to deposit to and withdraw from Lighter using the Relay API" — reads cleanly now.
  • Adapter code snippet's signMessage correctly references address (no lingering account reference).

Checklist

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references
  • Post review

· Branch ·

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Claude finished @pedromcunha's task in 1m 35s —— View job


Code Review

Re-reviewed after commit 79d32b2. No new changes in this revision vs. the prior review — 79d32b2, f9fadc0, 991d018, and f282ed2 all share the same commit message ("Fix lighter docs nits and feedback") and the files on disk match what I reviewed last round. One blocker remains, flagged now across five reviews; one pre-existing drift item stays open; two low-priority style nits linger.


🔴 Still unresolved — package namespace typo (flagged 5× now)

references/api/api_guides/lighter-support.mdx:887

yarn add @relay-protocol/lighter-ts-sdk

Every other Relay package across this repo uses the @relayprotocol/ scope — no hyphen. Line 881 in the same file is @relayprotocol/relay-lighter-wallet-adapter @relayprotocol/relay-sdk. Either:

  1. Typo — should be @relayprotocol/lighter-ts-sdk to match line 881.
  2. Third-party SDK — given the API host is zklighter.elliot.ai, the Lighter team's published package likely lives under a different org entirely (e.g. @elliot-labs/...). If so, the doc should show that exact scope, not something under a "relay" org.

@relay-protocol/... with a hyphen is almost certainly wrong and will break copy-paste for integrators. Please either confirm the real published name (a one-line reply is fine and we can leave it as-is) or fix it in this PR.

Fix this →


🟠 Still outstanding — H1 in body (pre-existing, not introduced by this PR)

references/api/api_guides/hyperliquid-support.mdx:8

## API Access

Good news — this is already ## on line 8. I miscounted in the prior review; hyperliquid-support.mdx is actually clean on this point. Apologies for the noise. Striking this through: # API Access on line 8 — nothing to fix here.


🟡 Style nits (unchanged — low-priority, judgment calls)

  • Parameter table row with slashreferences/api/api_guides/lighter-support.mdx:24 still combines **toChainId** / **fromChainId** into one row. Works, but two rows would scan more cleanly and match the repo's convention elsewhere.
  • Hard line breaks inside sentencesreferences/api/api_guides/lighter-support.mdx:877-878 still splits a sentence across two lines. Renders fine, just inconsistent with the rest of the file.

✅ Resolved from prior reviews (carried forward, still good)

  • Runtime bug in Lighter adapter snippet resolved — signMessage({ account: address, message }) correctly references the address from requestAddresses() (references/relay-kit/sdk/adapters.mdx:262-268).
  • Frontmatter description rephrased to "How to deposit to and withdraw from Lighter using the Relay API".
  • Intro paragraph broadened to cover both deposits and withdrawals.
  • Absolute URLs on lines 14 and 444 converted to root-relative.
  • # Prerequisites## Prerequisites; # API Access## API Access.
  • quote apiQuote API and lighter-specificLighter-specific on lines 839/873.
  • Hyperliquid Get Quote link (line 10) converted to root-relative.
  • Code-fence language tags (bash) applied on lines 880 and 886.
  • Parameter table now distinguishes deposit vs withdrawal parameters (user row for withdrawals).

Checklist

  • Read the changed files and diff
  • Check against CLAUDE.md style rules
  • Verify links and cross-references
  • Post review

Summary: The only remaining blocker is the @relay-protocol/lighter-ts-sdk scope on line 887. Everything else is either resolved or a judgment-call nit. Once the package name is confirmed (or fixed), this PR looks ready.

· · Branch

@pedromcunha pedromcunha merged commit 71f15df into main Apr 24, 2026
4 checks passed
@pedromcunha pedromcunha deleted the docs-drift/relayprotocol-relay-kit-pr-983-d3d6fe2 branch April 24, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants