@skate-org/amm-api-v2
v2.0.0-beta.18
Published
Skate AMM v2 SDK — REST client (action, position, quote)
Readme
@skate-org/amm-api-v2
REST clients for the Skate AMM v2 backend. All requests target the
unified base {env}.api.skatechain.org/amm-action-v2.
Surface
- Action / position:
getAction,waitForExecuted,getPosition - Quote (live REST clients):
swapQuote,mintQuote,burnQuote,increaseLiquidityQuote,decreaseLiquidityQuote,boostedMintQuote,boostedRangeQuote - Quote (polling stub for the deferred WS):
streamSwapQuote,subscribeSwapQuote— the real WebSocket server is not yet ready. Until it lands, both helpers run over HTTPS against/quote/stream/swap(default 4 s cadence). The function signatures are stable, so when WS ships caller code does not change — only the transport flips under the hood. QUOTE_ENDPOINTSintrospection registryfetchJson(retry / timeout / per-request hooks)- Errors:
ApiError,NotFoundError,NotImplementedError(all derive from@skate-org/amm-core-v2'sSdkError)
Install
pnpm add @skate-org/amm-api-v2Peer dep: @skate-org/amm-core-v2.
Quick start
import { swapQuote } from "@skate-org/amm-api-v2";
import { CHAIN } from "@skate-org/amm-core-v2";
const quote = await swapQuote(
{
srcChainId: CHAIN.ARBITRUM,
tokenA: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
tokenB: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
amount: 100000n,
user: "0x...",
recipient: "0x...",
slippageLimit: 0.01,
},
"DEV",
);See CHANGELOG.md for version history.
