[sdk}: intent quote service#966
Merged
Merged
Conversation
Member
|
better to be a method on the existing intent class |
Wizdave97
approved these changes
Jun 17, 2026
seunlanlege
reviewed
Jun 18, 2026
seunlanlege
reviewed
Jun 18, 2026
seunlanlege
approved these changes
Jun 18, 2026
Member
|
need to patch bump sdk |
Contributor
Author
It's already patched to |
…t-quote-service # Conflicts: # docs/content/developers/sdk/api/intent-gateway.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(sdk): add partner-facing intent quote API (
quoteIntent)Summary
Adds a strategy-based intent quoting API to the SDK so partners can price IntentGateway V2 orders before placing them. Uniswap V4 is the only strategy today, but the API is strategy-shaped (
strategy: "uniswap_v4"is the default) so new quote sources can be added without breaking partner integrations.What's included
IntentQuoteService/quoteIntent()(protocols/intents/quote/) — supports exact-input and exact-output quotes. Returns the raw amounts from the Uniswap V4 quoter with no slippage or fee adjustments; partners apply their own tolerance.quoteMetadataexposes the resolvedpoolKey,quoterAddress, and the source-chainprotocolFeeBps(read fromIntentGatewayV2.params()) so callers can account for the gateway's input fee when constructing the order.uniswapV4Pools, seeded with USDC/cNGN on Base). Same-chain quotes match configured pools by token address; cross-chain quotes matchtokenInby symbol since its source-chain address is meaningless against destination config. For unconfigured pairs, callers can pass an explicituniswapV4.poolKeyoverride (with optionalquoterAddressand, for cross-chain quotes,currencyIn— the destination-side input currency, validated against the pool to prevent silently quoting the wrong swap direction).uniswapV4Poolschain config field,ChainConfigService.getUniswapV4PoolConfigs()andgetAssetAddress().UnsupportedIntentQuoteStrategyError,UnsupportedIntentQuotePairError, and a clear failure when the V4 quoter is not configured for a chain instead of an opaqueeth_callfailure.quoteIntent(params)section inintent-gateway.mdx, including how to apply slippage and the protocol fee on top of the raw amounts.tests/sequential/intentGateway.test.ts.Notes for reviewers
protocolFeeBpsis the caller's responsibility (documented with a snippet in the docs).eth_callwith manual encode/decode since its quote functions arenonpayable.Test plan
pnpm test:intent-gateway(live Base RPC) — quotes 1 USDC → cNGN through the configured V4 pooltsc --noEmitpasses (two pre-existing errors in unrelated test files)Closes #963