SDK docs#2
Conversation
| --- | ||
|
|
||
| <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. |
There was a problem hiding this comment.
Is this the telltale em dash 🤖 ? Should we replace it, wdyt?
|
|
||
| ## External and TWAP orders | ||
|
|
||
| The SDK also supports two advanced order families that share the same build/sign/post pattern: |
| - 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. |
There was a problem hiding this comment.
Mention that swaps are single-chain only
| - **"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. |
| 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"] |
There was a problem hiding this comment.
Why do you call the FullSDK composable?
Composable would be a partial SDK that you compose from the methods you picked
| <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> |
|
|
||
| <CodeGroup> | ||
|
|
||
| ```ts axios |
There was a problem hiding this comment.
What is the use of axios in ts axios? I don't see the difference but there must be
| <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> |
| ### Anvil (Foundry) | ||
|
|
||
| ```bash | ||
| anvil --fork-url https://eth-mainnet.alchemyapi.io/v2/$ALCHEMY_KEY |
There was a problem hiding this comment.
Did you test this kind of anvil setup? This is very minimal, when our hardhat setup for tests is much more extensive
| 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 }, | ||
| }, | ||
| }, | ||
| ``` |
There was a problem hiding this comment.
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...


closes FRNT-1333