Skip to content

Commit

Permalink
fix: zrx base URLs (#5955)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Jan 8, 2024
1 parent 2a1bc35 commit 8298f8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ vi.mock('../utils/helpers/helpers', async () => {
const actual = await vi.importActual('../utils/helpers/helpers')
return {
...actual,
baseUrlFromChainId: vi.fn(() => 'https://0x.shapeshift.com/ethereum'),
baseUrlFromChainId: vi.fn(() => 'https://0x.shapeshift.com/ethereum/'),
}
})
vi.mock('@shapeshiftoss/chain-adapters', () => {
Expand Down Expand Up @@ -70,7 +70,7 @@ vi.mock('context/PluginProvider/chainAdapterSingleton', () => {
const mockOk = Ok
const mockErr = Err
describe('getZrxTradeQuote', () => {
const zrxService = zrxServiceFactory({ baseUrl: 'https://0x.shapeshift.com/ethereum' })
const zrxService = zrxServiceFactory({ baseUrl: 'https://0x.shapeshift.com/ethereum/' })

it('returns quote with fee data', async () => {
const { quoteInput } = setupQuote()
Expand Down
12 changes: 6 additions & 6 deletions src/lib/swapper/swappers/ZrxSwapper/utils/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ import { zrxSupportedChainIds } from '../../types'
export const baseUrlFromChainId = (chainId: ZrxSupportedChainId): string => {
switch (chainId) {
case KnownChainIds.EthereumMainnet:
return 'https:/0x.shapeshift.com/ethereum'
return 'https://0x.shapeshift.com/ethereum/'
case KnownChainIds.AvalancheMainnet:
return 'https:/0x.shapeshift.com/avalanche'
return 'https://0x.shapeshift.com/avalanche/'
case KnownChainIds.OptimismMainnet:
return 'https:/0x.shapeshift.com/optimism'
return 'https://0x.shapeshift.com/optimism/'
case KnownChainIds.BnbSmartChainMainnet:
return 'https:/0x.shapeshift.com/bnbsmartchain'
return 'https://0x.shapeshift.com/bnbsmartchain/'
case KnownChainIds.PolygonMainnet:
return 'https:/0x.shapeshift.com/polygon'
return 'https://0x.shapeshift.com/polygon/'
case KnownChainIds.ArbitrumMainnet:
return 'https:/0x.shapeshift.com/arbitrum'
return 'https://0x.shapeshift.com/arbitrum/'
default:
assertUnreachable(chainId)
}
Expand Down

0 comments on commit 8298f8f

Please sign in to comment.