mirror of
https://github.com/cerc-io/mars-interface.git
synced 2025-08-08 10:24:06 +00:00
18 lines
369 B
TypeScript
18 lines
369 B
TypeScript
type Options = {
|
|
from?: string
|
|
to: string
|
|
baseUrl: string
|
|
}
|
|
|
|
export const getSwapUrl = (options: Options) => {
|
|
const { from, to, baseUrl } = options
|
|
let fromName = from
|
|
let toName = to
|
|
|
|
if (!fromName) fromName = 'ATOM'
|
|
if (fromName === to) fromName = 'OSMO'
|
|
if (to === 'axlUSDC') toName = 'USDC'
|
|
|
|
return `${baseUrl}?from=${fromName}&to=${toName}`
|
|
}
|