Skip to content

Conversation

@andriy-shymkiv
Copy link
Contributor

@andriy-shymkiv andriy-shymkiv commented Jan 15, 2026

Updates BridgePrice types


Note

  • Delta pricing/types:
    • BridgePriceInfo now includes fastest, bestReturn, recommended flags
    • AvailableBridge refactored to include bridge and bridgeInfo; carries receivedDest* fields
    • Re-exports AvailableBridge and updates SDK surface in src/index.ts
  • Bridge info: BridgeProtocolResponse now includes icon
  • Quote API: getQuote accepts maxImpact and maxUSDImpact
  • Swap APIs: rename query param usage from network to chainId in adapters, rates, spender, swapTx and update related docs/comments
  • Tests: snapshots and expectations updated to new Delta bridge fields and shapes
  • Version: bump to 9.3.1

Written by Cursor Bugbot for commit 8195608. This will update automatically on new commits. Configure here.

@github-actions
Copy link

github-actions bot commented Jan 15, 2026

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 15.83 KB (0%)
dist/sdk.esm.js 15.69 KB (0%)

Base automatically changed from feat/crosschain_LOs to master January 16, 2026 13:11
Copy link
Member

@Velenir Velenir left a comment

Choose a reason for hiding this comment

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

  1. Shape changed, a bunch of tests that use MatchSnapshot broke. Change API_URL when running tests to see
  2. Since you are changing types, could you add maxImpact param to getQuote method? It was added in API at some point recently.

Comment on lines +109 to +112
| 'receivedDestAmount'
| 'receivedDestAmountBeforeFee'
| 'receivedDestUSD'
| 'receivedDestUSDBeforeFee'
Copy link
Member

Choose a reason for hiding this comment

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

Could you check if srcAmountBeforeFee and other props specific for BUY are also added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, availableBridges doesn't include src* stuff

Copy link
Member

Choose a reason for hiding this comment

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

should it though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the src* props would be the same across all bridges in availableBridges. I don't know if it's worth increasing price response by duplicating them, but on the other hand it wouldn't be bad to have AvailablePrice equal to BridgePrice.

export type BridgeProtocolResponse = {
protocol: string;
displayName: string;
icon: string; // CDN URL
Copy link
Member

Choose a reason for hiding this comment

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

Not necessarily CDN, let's not limit ourselves 😉

@andriy-shymkiv
Copy link
Contributor Author

Since you are changing types, could you add maxImpact param to getQuote method? It was added in API at some point recently.

Added 1216a51

@andriy-shymkiv
Copy link
Contributor Author

Shape changed, a bunch of tests that use MatchSnapshot broke. Change API_URL when running tests to see

I fixed the snapshot, but a bunch of tests are still failing, though none of them are related to my change (I hope)
Could you try to run tests against orders API on your side please? 🙏🏻

/** @description Partner string */
partner?: string;
/** @description Maximum price impact (in percentage) acceptable for the trade */
maxImpact?: number;
Copy link
Member

Choose a reason for hiding this comment

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

maxImpactUSD?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Somehow I didn't notice it
Added 2936ff5

@Velenir
Copy link
Member

Velenir commented Jan 21, 2026

Could you also replace wherever we make requests with ?network= to ?chainId=.
An alias was introduced in API for /price and /delta already had ?chainId everywhere.
We should use chainId only to be consistent.
Basically in every place we have

constructSearchString({
...
network: chainId
})

they all now work with plain chainId

@andriy-shymkiv
Copy link
Contributor Author

Could you also replace wherever we make requests with ?network= to ?chainId=.

Done 45018d2

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@andriy-shymkiv andriy-shymkiv merged commit c47b68b into master Jan 23, 2026
2 of 4 checks passed
@andriy-shymkiv andriy-shymkiv deleted the feat/bridge-price-shape branch January 23, 2026 11: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