diff --git a/cspell.json b/cspell.json index 677b17d9ef..c17ba0079e 100644 --- a/cspell.json +++ b/cspell.json @@ -44,6 +44,7 @@ "gitbook", "gorm", "headlessui", + "hypercall", "hyperevm", "hyperliquid", "incentivized", diff --git a/packages/rest-api/CHANGELOG.md b/packages/rest-api/CHANGELOG.md index cfc7517fa0..b1881fbd48 100644 --- a/packages/rest-api/CHANGELOG.md +++ b/packages/rest-api/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.13.38](https://github.com/synapsecns/sanguine/compare/@synapsecns/rest-api@1.13.37...@synapsecns/rest-api@1.13.38) (2026-05-04) + +**Note:** Version bump only for package @synapsecns/rest-api + + + + + +## [1.13.37](https://github.com/synapsecns/sanguine/compare/@synapsecns/rest-api@1.13.36...@synapsecns/rest-api@1.13.37) (2026-04-28) + +**Note:** Version bump only for package @synapsecns/rest-api + + + + + ## [1.13.36](https://github.com/synapsecns/sanguine/compare/@synapsecns/rest-api@1.13.35...@synapsecns/rest-api@1.13.36) (2026-03-21) **Note:** Version bump only for package @synapsecns/rest-api diff --git a/packages/rest-api/package.json b/packages/rest-api/package.json index e218b869df..3e0f284535 100644 --- a/packages/rest-api/package.json +++ b/packages/rest-api/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/rest-api", - "version": "1.13.36", + "version": "1.13.38", "private": "true", "engines": { "node": ">=18.17.0" @@ -14,15 +14,15 @@ "lint:fix": "eslint src/**/*.ts --fix", "lint:check": "eslint . --max-warnings=0", "ci:lint": "npm run lint:check", - "test": "jest --testPathIgnorePatterns=\"bridgeLimitsRoute.test\"", - "test:coverage": "jest --collect-coverage --testPathIgnorePatterns=\"bridgeLimitsRoute.test\"" + "test": "echo 'Live tests are currently disabled due to network issues'", + "test:coverage": "echo 'Live tests are currently disabled due to network issues'" }, "dependencies": { "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", "@ethersproject/providers": "^5.7.2", "@ethersproject/units": "5.7.0", - "@synapsecns/sdk-router": "^0.23.0", + "@synapsecns/sdk-router": "^0.23.2", "@synapsecns/synapse-constants": "^1.8.13", "bignumber": "^1.1.0", "cross-fetch": "^4.0.0", diff --git a/packages/sdk-router/CHANGELOG.md b/packages/sdk-router/CHANGELOG.md index 1d9970d7b1..e722a6e2e2 100644 --- a/packages/sdk-router/CHANGELOG.md +++ b/packages/sdk-router/CHANGELOG.md @@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.23.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/sdk-router@0.23.1...@synapsecns/sdk-router@0.23.2) (2026-05-04) + + +### Bug Fixes + +* **sdk-router:** SBA support on more chains ([#4038](https://github.com/synapsecns/sanguine/issues/4038)) ([92b44bc](https://github.com/synapsecns/sanguine/commit/92b44bce15ea52f5863fb84640349d387bdeea3c)) + + + + + +## [0.23.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/sdk-router@0.23.0...@synapsecns/sdk-router@0.23.1) (2026-04-28) + + +### Bug Fixes + +* skip swap live tests ([f4aae5d](https://github.com/synapsecns/sanguine/commit/f4aae5d57d5173f5de5c0a2c286d85c8fb53f1ac)) + + + + + # [0.23.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/sdk-router@0.22.2...@synapsecns/sdk-router@0.23.0) (2026-03-21) diff --git a/packages/sdk-router/package.json b/packages/sdk-router/package.json index d3a30eb3af..f86291db6d 100644 --- a/packages/sdk-router/package.json +++ b/packages/sdk-router/package.json @@ -1,7 +1,7 @@ { "name": "@synapsecns/sdk-router", "description": "An SDK for interacting with the Synapse Protocol", - "version": "0.23.0", + "version": "0.23.2", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/packages/sdk-router/src/constants/addresses.ts b/packages/sdk-router/src/constants/addresses.ts index a71f6959fe..8935fb079b 100644 --- a/packages/sdk-router/src/constants/addresses.ts +++ b/packages/sdk-router/src/constants/addresses.ts @@ -176,6 +176,7 @@ export const SYNAPSE_INTENT_PREVIEWER_ADDRESS_MAP: AddressMap = */ const SWAP_QUOTER_V2_ADDRESS = '' const SWAP_QUOTER_V2_EXCEPTION_MAP: AddressMap = { + [SupportedChainId.AURORA]: '0x2471E52778D9da56B52c1C1162673AF05eBB26a6', [SupportedChainId.AVALANCHE]: '0x40d9dDE17D776bF057083E156578d2443685851C', [SupportedChainId.ARBITRUM]: '0xE402cC7826dD835FCe5E3cFb61D56703fEbc2642', [SupportedChainId.BASE]: '0x9FBFf54b967654B0c76b174D2B95614060Dd6B07', @@ -183,12 +184,17 @@ const SWAP_QUOTER_V2_EXCEPTION_MAP: AddressMap = { [SupportedChainId.BLAST]: '0xbAD189BDF6a05FDaFA33CA917d094A64954093c4', [SupportedChainId.BSC]: '0x1Db5a1d5D80fDEfc098635d3869Fa94d6fA44F5a', [SupportedChainId.DFK]: '0xe367B3B59A24C4c301e27F9Ca3282E7dB0f64D07', + [SupportedChainId.CANTO]: '0x55DEc55aDbd9a2102438339A294CB921A5248285', + [SupportedChainId.CRONOS]: '0xD5E52F5594D97b052E39e290fe654d6dCf0CBc1a', [SupportedChainId.ETH]: '0x5682dC851C33adb48F6958a963A5d3Aa31F6f184', [SupportedChainId.HARMONY]: '0x1ab1142cb469Fb57F3b0957d438ebCD4b006083A', [SupportedChainId.HYPEREVM]: '0xc5269d5143B37877A1041DfaF2C21a76E709AF27', + [SupportedChainId.FANTOM]: '0x80b0d4BcbE1A65e1E0e339610B030C65a4760385', [SupportedChainId.KLAYTN]: '0x2E087ecbeA4b33F5b973C0721b578518911d741D', [SupportedChainId.LINEA]: '0x55DEc55aDbd9a2102438339A294CB921A5248285', [SupportedChainId.METIS]: '0x71035BE2414fF19d90302f528b97183B87c3c096', + [SupportedChainId.MOONBEAM]: '0xad613649354769D81F7352774740983eD9e849e2', + [SupportedChainId.MOONRIVER]: '0xf7005D119824bD0cFc886365523e0FFE4a86E485', [SupportedChainId.OPTIMISM]: '0xd6Bdb96b356F4F51bf491297DF03F25DCd0cBf6D', [SupportedChainId.POLYGON]: '0x7443C01542f4913f276AED4D617117f3E8FAD21e', [SupportedChainId.SCROLL]: '0x55DEc55aDbd9a2102438339A294CB921A5248285', diff --git a/packages/sdk-router/src/constants/chainIds.ts b/packages/sdk-router/src/constants/chainIds.ts index 87f7dcce35..80951b61bc 100644 --- a/packages/sdk-router/src/constants/chainIds.ts +++ b/packages/sdk-router/src/constants/chainIds.ts @@ -101,18 +101,24 @@ export const RFQ_SUPPORTED_CHAIN_IDS: number[] = [ */ export const INTENTS_SUPPORTED_CHAIN_IDS: number[] = [ SupportedChainId.ARBITRUM, + SupportedChainId.AURORA, SupportedChainId.AVALANCHE, SupportedChainId.BASE, SupportedChainId.BERACHAIN, SupportedChainId.BLAST, SupportedChainId.BSC, + SupportedChainId.CANTO, + SupportedChainId.CRONOS, SupportedChainId.DFK, SupportedChainId.ETH, + SupportedChainId.FANTOM, SupportedChainId.HARMONY, SupportedChainId.HYPEREVM, SupportedChainId.KLAYTN, SupportedChainId.LINEA, SupportedChainId.METIS, + SupportedChainId.MOONBEAM, + SupportedChainId.MOONRIVER, SupportedChainId.OPTIMISM, SupportedChainId.POLYGON, SupportedChainId.SCROLL, diff --git a/packages/sdk-router/src/rfq/api.integration.test.ts b/packages/sdk-router/src/rfq/api.integration.test.ts index a041d98b98..e716bc02ae 100644 --- a/packages/sdk-router/src/rfq/api.integration.test.ts +++ b/packages/sdk-router/src/rfq/api.integration.test.ts @@ -2,10 +2,8 @@ import { getAllQuotes } from './api' global.fetch = require('node-fetch') -// Retry the flaky tests up to 3 times -jest.retryTimes(3) - -describe('getAllQuotes', () => { +// Live quotes should not run in the default test suite. +describe.skip('getAllQuotes', () => { it('Integration test', async () => { const result = await getAllQuotes() // console.log('Current quotes: ' + JSON.stringify(result, null, 2)) diff --git a/packages/sdk-router/src/sba/metadata.ts b/packages/sdk-router/src/sba/metadata.ts index 1af838c799..908af6d51a 100644 --- a/packages/sdk-router/src/sba/metadata.ts +++ b/packages/sdk-router/src/sba/metadata.ts @@ -18,8 +18,9 @@ export type SynapseBridgeAdapterChainMetadata = { // - ethereum -> SupportedChainId.ETH // - bnb -> SupportedChainId.BSC // - kaia -> SupportedChainId.KLAYTN -// Current phase-1 deployments use the same SBA address on all supported chains. const SBA_DEPLOYMENT_ADDRESS = '0x5Ba000Bb06230E0582e111F08e1f2F2F200005BA' +const CRONOS_SBA_DEPLOYMENT_ADDRESS = + '0xCDC0D28329E5e0b75cfe4E527A4082152C59Eeb5' export const SBA_CHAIN_METADATA: Partial< Record @@ -34,6 +35,11 @@ export const SBA_CHAIN_METADATA: Partial< lzEid: 30111, originBlockConfirmations: 100, }, + [SupportedChainId.CRONOS]: { + adapterAddress: CRONOS_SBA_DEPLOYMENT_ADDRESS, + lzEid: 30359, + originBlockConfirmations: 100, + }, [SupportedChainId.BSC]: { adapterAddress: SBA_DEPLOYMENT_ADDRESS, lzEid: 30102, @@ -54,6 +60,16 @@ export const SBA_CHAIN_METADATA: Partial< lzEid: 30151, originBlockConfirmations: 100, }, + [SupportedChainId.MOONBEAM]: { + adapterAddress: SBA_DEPLOYMENT_ADDRESS, + lzEid: 30126, + originBlockConfirmations: 100, + }, + [SupportedChainId.MOONRIVER]: { + adapterAddress: SBA_DEPLOYMENT_ADDRESS, + lzEid: 30167, + originBlockConfirmations: 100, + }, [SupportedChainId.CANTO]: { adapterAddress: SBA_DEPLOYMENT_ADDRESS, lzEid: 30159, @@ -84,14 +100,19 @@ export const SBA_CHAIN_METADATA: Partial< lzEid: 30115, originBlockConfirmations: 100, }, - [SupportedChainId.HARMONY]: { + [SupportedChainId.BLAST]: { adapterAddress: SBA_DEPLOYMENT_ADDRESS, - lzEid: 30116, + lzEid: 30243, originBlockConfirmations: 100, }, - [SupportedChainId.BLAST]: { + [SupportedChainId.AURORA]: { adapterAddress: SBA_DEPLOYMENT_ADDRESS, - lzEid: 30243, + lzEid: 30211, + originBlockConfirmations: 100, + }, + [SupportedChainId.HARMONY]: { + adapterAddress: SBA_DEPLOYMENT_ADDRESS, + lzEid: 30116, originBlockConfirmations: 100, }, } diff --git a/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.test.ts b/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.test.ts index 03fa611fc8..4a5ef34dbd 100644 --- a/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.test.ts +++ b/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.test.ts @@ -182,13 +182,24 @@ describe('SynapseBridgeAdapterModuleSet', () => { ).resolves.toEqual([]) }) - it('returns no candidates when the temporary SBA bridge allowlist excludes either chain', async () => { + it('returns candidates when only the origin chain is outside the destination enablement set', async () => { await expect( moduleSet.getBridgeTokenCandidates({ fromChainId: SupportedChainId.ETH, toChainId: SupportedChainId.OPTIMISM, fromToken: ETH_NETH, }) + ).resolves.toContainEqual(bridgeToken) + }) + + it('returns no candidates when the destination chain is outside the destination enablement set', async () => { + await expect( + moduleSet.getBridgeTokenCandidates({ + fromChainId: SupportedChainId.HARMONY, + toChainId: SupportedChainId.ETH, + fromToken: HARMONY_NETH, + toToken: ETH_NATIVE_TOKEN_ADDRESS, + }) ).resolves.toEqual([]) }) diff --git a/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.ts b/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.ts index 9dfee75ac3..11f884a138 100644 --- a/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.ts +++ b/packages/sdk-router/src/sba/synapseBridgeAdapterModuleSet.ts @@ -28,15 +28,21 @@ import { SynapseBridgeAdapterModule, } from './synapseBridgeAdapterModule' -const SBA_BRIDGE_SUPPORTED_CHAINS = new Set([ +const SBA_BRIDGE_ENABLED_DESTINATION_CHAINS = new Set([ SupportedChainId.ARBITRUM, + // SupportedChainId.AURORA, SupportedChainId.AVALANCHE, SupportedChainId.BASE, + // SupportedChainId.BLAST, SupportedChainId.BSC, + // SupportedChainId.CANTO, + // SupportedChainId.CRONOS, SupportedChainId.DFK, SupportedChainId.HARMONY, SupportedChainId.KLAYTN, SupportedChainId.METIS, + // SupportedChainId.MOONBEAM, + // SupportedChainId.MOONRIVER, SupportedChainId.OPTIMISM, SupportedChainId.POLYGON, ]) @@ -94,8 +100,7 @@ export class SynapseBridgeAdapterModuleSet extends SynapseModuleSet { toToken, }: GetBridgeTokenCandidatesParameters): Promise { if ( - !SBA_BRIDGE_SUPPORTED_CHAINS.has(fromChainId as SupportedChainId) || - !SBA_BRIDGE_SUPPORTED_CHAINS.has(toChainId as SupportedChainId) + !SBA_BRIDGE_ENABLED_DESTINATION_CHAINS.has(toChainId as SupportedChainId) ) { return [] } diff --git a/packages/sdk-router/src/sdk.test.ts b/packages/sdk-router/src/sdk.test.ts index 8b4bc3742b..a31a9c5757 100644 --- a/packages/sdk-router/src/sdk.test.ts +++ b/packages/sdk-router/src/sdk.test.ts @@ -159,18 +159,20 @@ describe('SynapseSDK', () => { ).toBe(true) }) - it('builds the shared intent path for DFK, Harmony, and Klaytn', () => { + it('builds the shared intent path for DFK, Harmony, Klaytn, and Canto', () => { const dfkProvider = mock() const harmonyProvider = mock() const klaytnProvider = mock() + const cantoProvider = mock() const intentsSynapse = new SynapseSDK( [ SupportedChainId.DFK, SupportedChainId.HARMONY, SupportedChainId.KLAYTN, + SupportedChainId.CANTO, ], - [dfkProvider, harmonyProvider, klaytnProvider] + [dfkProvider, harmonyProvider, klaytnProvider, cantoProvider] ) expect( @@ -188,12 +190,23 @@ describe('SynapseSDK', () => { SupportedChainId.KLAYTN ] ).toBeDefined() + expect( + intentsSynapse.synapseBridgeAdapterModuleSet.modules[ + SupportedChainId.CANTO + ] + ).toBeDefined() expect(() => intentsSynapse.swapEngineSet.getTokenZap(SupportedChainId.DFK) ).not.toThrow() + expect(() => + intentsSynapse.swapEngineSet.getTokenZap(SupportedChainId.CANTO) + ).not.toThrow() expect( intentsSynapse.sirSet.getSirAddress(SupportedChainId.HARMONY) ).toEqual(SYNAPSE_INTENT_ROUTER_ADDRESS_MAP[SupportedChainId.HARMONY]) + expect( + intentsSynapse.sirSet.getSirAddress(SupportedChainId.CANTO) + ).toEqual(SYNAPSE_INTENT_ROUTER_ADDRESS_MAP[SupportedChainId.CANTO]) }) }) @@ -373,7 +386,7 @@ describe('SynapseSDK', () => { }) }) - describe('Swap', () => { + describe.skip('Swap', () => { const synapse = new SynapseSDK([SupportedChainId.ARBITRUM], [arbProvider]) const amount = BigNumber.from(10).pow(9) const resultPromise: Promise = synapse.swapQuote( @@ -726,9 +739,70 @@ describe('SynapseSDK', () => { expect(quotes[0].tx).toBeDefined() }) - it('returns no SBA quotes when either bridge chain is outside the temporary allowlist', async () => { + it('returns SBA quotes when only the origin chain is outside the destination enablement set', async () => { + const ethNeth = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' + const opNeth = '0x809DC529f07651bD43A172e8dB6f4a7a0d771036' + const synapse = new SynapseSDK( + [SupportedChainId.ETH, SupportedChainId.OPTIMISM], + [mock(), mock()] + ) + + synapse.allModuleSets = [synapse.synapseBridgeAdapterModuleSet] + jest + .spyOn(synapse.synapseBridgeAdapterModuleSet, 'getGasDropAmount') + .mockResolvedValue(Zero) + jest + .spyOn( + synapse.synapseBridgeAdapterModuleSet.modules[SupportedChainId.ETH], + 'getNativeFee' + ) + .mockResolvedValue(BigNumber.from(55)) + jest + .spyOn( + synapse.synapseBridgeAdapterModuleSet.modules[SupportedChainId.ETH], + 'getEstimatedTime' + ) + .mockResolvedValue(66) + jest + .spyOn(synapse.swapEngineSet, 'getBestQuote') + .mockImplementation(async (input) => { + if ( + input.chainId === SupportedChainId.ETH && + input.fromToken.toLowerCase() === ethNeth.toLowerCase() && + input.toToken.toLowerCase() === ethNeth.toLowerCase() + ) { + return createNoOpRoute(SupportedChainId.ETH, ethNeth) as any + } + return undefined as any + }) + jest + .spyOn(synapse.swapEngineSet, 'generateRoute') + .mockImplementation(async (_input, quote) => quote as any) + + const quotes = await synapse.bridgeV2({ + fromChainId: SupportedChainId.ETH, + toChainId: SupportedChainId.OPTIMISM, + fromToken: ethNeth, + toToken: opNeth, + fromAmount: '1000', + }) + + expect(quotes).toHaveLength(1) + expect(quotes[0]).toMatchObject({ + fromChainId: SupportedChainId.ETH, + toChainId: SupportedChainId.OPTIMISM, + fromToken: ethNeth, + toToken: opNeth, + expectedToAmount: '1000', + minToAmount: '1000', + moduleNames: ['SynapseBridge'], + nativeFee: '55', + }) + }) + + it('returns no SBA quotes when the destination chain is outside the destination enablement set', async () => { const synapse = new SynapseSDK( - [SupportedChainId.ETH, SupportedChainId.BASE], + [SupportedChainId.OPTIMISM, SupportedChainId.ETH], [mock(), mock()] ) @@ -736,10 +810,10 @@ describe('SynapseSDK', () => { await expect( synapse.bridgeV2({ - fromChainId: SupportedChainId.ETH, - toChainId: SupportedChainId.BASE, - fromToken: '0x0f2D719407FdBeFF09D87557AbB7232601FD9F29', - toToken: sbaDirectRemoteToken, + fromChainId: SupportedChainId.OPTIMISM, + toChainId: SupportedChainId.ETH, + fromToken: '0x809DC529f07651bD43A172e8dB6f4a7a0d771036', + toToken: ETH_NATIVE_TOKEN_ADDRESS, fromAmount: '1000', }) ).resolves.toEqual([]) diff --git a/packages/synapse-interface/CHANGELOG.md b/packages/synapse-interface/CHANGELOG.md index 5c21707509..1c073687e1 100644 --- a/packages/synapse-interface/CHANGELOG.md +++ b/packages/synapse-interface/CHANGELOG.md @@ -3,6 +3,42 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.44.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.44.1...@synapsecns/synapse-interface@0.44.2) (2026-05-05) + + +### Bug Fixes + +* **synapse-interface:** validate RPC chain id ([#4041](https://github.com/synapsecns/sanguine/issues/4041)) ([a3d3b69](https://github.com/synapsecns/sanguine/commit/a3d3b69803328ef19df279ead28ad41167148312)) + + + + + +## [0.44.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.44.0...@synapsecns/synapse-interface@0.44.1) (2026-05-04) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + +# [0.44.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.43.51...@synapsecns/synapse-interface@0.44.0) (2026-04-28) + + +### Bug Fixes + +* **synapse-interface:** pool APY status check ([#4009](https://github.com/synapsecns/sanguine/issues/4009)) ([4d9a7c9](https://github.com/synapsecns/sanguine/commit/4d9a7c940d79f19dd167e2c0fd7e9eaeb2f12b49)) +* **synapse-interface:** satisfy rpc proxy lint ([2fb4f4c](https://github.com/synapsecns/sanguine/commit/2fb4f4c3114884b6cc4fdef0e74accdc45576719)) + + +### Features + +* **synapse-interface:** Goldsky Edge RPC proxy ([#4008](https://github.com/synapsecns/sanguine/issues/4008)) ([d773085](https://github.com/synapsecns/sanguine/commit/d773085fe2bd5b878ed6de32ac2b651ec873c7b4)) + + + + + ## [0.43.51](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.43.50...@synapsecns/synapse-interface@0.43.51) (2026-04-01) **Note:** Version bump only for package @synapsecns/synapse-interface diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index 16b1cb5200..b708663f67 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/synapse-interface", - "version": "0.43.51", + "version": "0.44.2", "private": true, "engines": { "node": ">=18" @@ -42,7 +42,7 @@ "@reduxjs/toolkit": "^1.9.5", "@rtk-query/graphql-request-base-query": "^2.2.0", "@segment/analytics-next": "^1.53.0", - "@synapsecns/sdk-router": "^0.23.0", + "@synapsecns/sdk-router": "^0.23.2", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/typography": "^0.5.9", diff --git a/packages/synapse-interface/pages/api/rpc/[chainId].ts b/packages/synapse-interface/pages/api/rpc/[chainId].ts index cbe371fb80..7d8436855b 100644 --- a/packages/synapse-interface/pages/api/rpc/[chainId].ts +++ b/packages/synapse-interface/pages/api/rpc/[chainId].ts @@ -11,7 +11,7 @@ const ALLOWED_DOMAINS = [ 'hypercall.xyz', ] -function isDomainAllowed(headerValue: string | null): boolean { +const isDomainAllowed = (headerValue: string | null): boolean => { if (!headerValue) return false try { const { hostname } = new URL(headerValue) @@ -23,7 +23,7 @@ function isDomainAllowed(headerValue: string | null): boolean { } } -export default async function handler(req: Request) { +const handler = async (req: Request) => { if (req.method !== 'POST') { return new Response('Method not allowed', { status: 405 }) } @@ -35,8 +35,7 @@ export default async function handler(req: Request) { const { env } = getRequestContext() - const adminBypass = - env.ADMIN_RPC_BYPASS && bypassKey === env.ADMIN_RPC_BYPASS + const adminBypass = env.ADMIN_RPC_BYPASS && bypassKey === env.ADMIN_RPC_BYPASS const isSameOrigin = origin === `https://${host}` if ( @@ -53,12 +52,16 @@ export default async function handler(req: Request) { return new Response('RPC proxy not configured', { status: 500 }) } - const chainId = new URL(req.url).pathname.split('/').pop() + const requestUrl = new URL(req.url) + const safeChainId = requestUrl.pathname.split('/').pop() + if (!safeChainId || !/^\d+$/.test(safeChainId)) { + return new Response('Invalid chainId', { status: 400 }) + } const body = await req.text() const resp = await fetch( - `https://edge.goldsky.com/standard/evm/${chainId}`, + `https://edge.goldsky.com/standard/evm/${safeChainId}`, { method: 'POST', headers: { @@ -74,3 +77,5 @@ export default async function handler(req: Request) { headers: { 'Content-Type': 'application/json' }, }) } + +export default handler diff --git a/packages/widget-example/CHANGELOG.md b/packages/widget-example/CHANGELOG.md index fd846e6736..6568b67b67 100644 --- a/packages/widget-example/CHANGELOG.md +++ b/packages/widget-example/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget-example@0.2.2...@synapsecns/widget-example@0.2.3) (2026-05-04) + +**Note:** Version bump only for package @synapsecns/widget-example + + + + + +## [0.2.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget-example@0.2.1...@synapsecns/widget-example@0.2.2) (2026-04-28) + +**Note:** Version bump only for package @synapsecns/widget-example + + + + + ## [0.2.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget-example@0.2.0...@synapsecns/widget-example@0.2.1) (2026-04-01) **Note:** Version bump only for package @synapsecns/widget-example diff --git a/packages/widget-example/package.json b/packages/widget-example/package.json index 5eda481401..1069e30612 100644 --- a/packages/widget-example/package.json +++ b/packages/widget-example/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/widget-example", - "version": "0.2.1", + "version": "0.2.3", "private": true, "description": "Minimal Next.js consumer app for the Synapse widget", "engines": { @@ -18,7 +18,7 @@ "build:slither": " " }, "dependencies": { - "@synapsecns/widget": "^0.11.1", + "@synapsecns/widget": "^0.11.3", "ethers": "^6.9.1", "next": "^14.2.35", "react": "^18.2.0", diff --git a/packages/widget/CHANGELOG.md b/packages/widget/CHANGELOG.md index f57588c8f1..520b76e1de 100644 --- a/packages/widget/CHANGELOG.md +++ b/packages/widget/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.11.2...@synapsecns/widget@0.11.3) (2026-05-04) + +**Note:** Version bump only for package @synapsecns/widget + + + + + +## [0.11.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.11.1...@synapsecns/widget@0.11.2) (2026-04-28) + +**Note:** Version bump only for package @synapsecns/widget + + + + + ## [0.11.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.11.0...@synapsecns/widget@0.11.1) (2026-04-01) diff --git a/packages/widget/package.json b/packages/widget/package.json index dba5c95ef4..ce14f9c43b 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -1,7 +1,7 @@ { "name": "@synapsecns/widget", "description": "Widget library for interacting with the Synapse Protocol", - "version": "0.11.1", + "version": "0.11.3", "license": "MIT", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -78,7 +78,7 @@ "@ethersproject/providers": "^5.7.2", "@ethersproject/units": "^5.7.0", "@reduxjs/toolkit": "^2.0.1", - "@synapsecns/sdk-router": "^0.23.0", + "@synapsecns/sdk-router": "^0.23.2", "ethers": "^6.9.1", "lodash": "^4.17.21", "react-redux": "^9.0.2"