Skip to content

SDK docs#2

Open
andriy-shymkiv wants to merge 15 commits into
mainfrom
integrate/sdk
Open

SDK docs#2
andriy-shymkiv wants to merge 15 commits into
mainfrom
integrate/sdk

Conversation

@andriy-shymkiv
Copy link
Copy Markdown
Member

closes FRNT-1333

@linear
Copy link
Copy Markdown

linear Bot commented May 27, 2026

FRNT-1333

Comment thread sdk/modules/delta.mdx
---

<Note>This page is a stub. Content coming soon.</Note>
The Delta module wraps the [Delta API](/delta/overview) — gasless, MEV-protected swaps where the user signs an off-chain order and a network of solvers (Portikus) competes to fill it. The user pays no gas; the solver covers execution cost out of their margin.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the telltale em dash 🤖 ? Should we replace it, wdyt?

Comment thread sdk/modules/delta.mdx

## External and TWAP orders

The SDK also supports two advanced order families that share the same build/sign/post pattern:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we call them families?

Comment thread sdk/modules/swap.mdx
Comment on lines +11 to +13
- The user has gas on the source chain and is happy to submit a transaction.
- You need the cheapest path across DEX aggregation (no auction, no off-chain settlement).
- You want full control over slippage, gas, and recipient.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that swaps are single-chain only

Comment thread sdk/choose-a-variant.mdx
Comment on lines +22 to +23
- **"I just want a quote and a swap."** Use the **Simple SDK** — one constructor, ready to call.
- **"I have a Node service that does Delta orders, market swaps, and price polling."** Use the **Full SDK** — namespaced access plus a typed `<TxResponse>` so your code knows what `approveToken` returns.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple SDK is also namespaced

Comment thread sdk/composable-sdk.mdx
Comment on lines 2 to +4
title: "Composable SDK"
description: "Use the tree-shakeable, modular SDK when bundle size matters."
keywords: ["sdk","composable","tree-shaking"]
description: "constructFullSDK gives you every namespace (sdk.swap, sdk.delta, sdk.quote) over a fetcher and contract caller you construct yourself, with a typed transaction-response generic."
keywords: ["sdk", "composable", "constructFullSDK", "full"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you call the FullSDK composable?
Composable would be a partial SDK that you compose from the methods you picked

Comment thread sdk/overview.mdx
Comment on lines +11 to +16
<CardGroup cols={3}>
<Card title="Versatile" icon="plug">
Works with [viem](https://viem.sh), [ethers](https://docs.ethers.org) (v5 or
v6), or [web3.js](https://web3js.readthedocs.io) — bring whichever stack you
already use.
</Card>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these links don't display like you would expect

Image

Comment thread sdk/simple-sdk.mdx

<CodeGroup>

```ts axios
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use of axios in ts axios? I don't see the difference but there must be

Comment thread sdk/simple-sdk.mdx
Comment on lines +99 to +101
<Note>
Write calls always resolve to a **transaction hash** (`string`). If you need the library-typed response object (viem's `Hex`, `ethers.ContractTransaction`, etc.), use [`constructFullSDK`](/sdk/composable-sdk) with the `<TxResponse>` generic.
</Note>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, md doesn't really work when inside mdx Component

Image

### Anvil (Foundry)

```bash
anvil --fork-url https://eth-mainnet.alchemyapi.io/v2/$ALCHEMY_KEY
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this kind of anvil setup? This is very minimal, when our hardhat setup for tests is much more extensive

Comment on lines +56 to +65
The SDK's own tests use a Hardhat fork seeded via the `PROVIDER_URL` env var. The same approach works for your integration:

```js
// hardhat.config.ts
networks: {
hardhat: {
forking: { url: process.env.PROVIDER_URL },
},
},
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same approach works for your integration

Does it really work? Our hardhat set up for SDK test is much more involved.
We have specific params for gas, chain, methods to create forks...

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