@rarimo/swap
Version:
Internal tools that other Rarimo packages use to swap tokens.
57 lines (51 loc) • 2.51 kB
text/typescript
import type { ChainId } from '@rarimo/shared'
import { ChainNames, EVM_CHAIN_IDS } from '@rarimo/shared'
import { SwapCommands } from '@/enums'
export const CONTRACT_BALANCE =
'0x8000000000000000000000000000000000000000000000000000000000000000'
export const THIS_ADDRESS = '0x0000000000000000000000000000000000000001'
export const CALLER_ADDRESS = '0x0000000000000000000000000000000000000002'
const IDS = EVM_CHAIN_IDS as { [key in ChainNames]: ChainId }
export const WRAPPED_CHAIN_TOKEN_SYMBOLS = {
// Ethereum
[]]: 'WETH',
[]]: 'WETH',
// Polygon
[]]: 'WMATIC',
// Avalanche
[]]: 'WAVAX',
[]]: 'WAVAX',
// BSC
[]]: 'WBNB',
[]]: 'WBNB',
}
export const SWAP_COMMANDS_NAME_MAP: { [key in SwapCommands]?: string } = {
[]: 'bridgeERC20',
[]: 'bridgeERC721',
[]: 'bridgeERC1155',
[]: 'bridgeNative',
[]: 'transferERC20',
[]: 'transferERC721',
[]: 'transferERC1155',
[]: 'transferNative',
[]: 'transferFromERC20',
[]: 'transferFromERC721',
[]: 'transferFromERC1155',
[]: 'wrap',
[]: 'unwrap',
[]: 'multicall',
[]: 'swapExactTokensForTokensV2',
[]: 'swapTokensForExactTokensV2',
[]: 'swapExactETHForTokens',
[]: 'swapTokensForExactETH',
[]: 'swapExactTokensForETH',
[]: 'swapETHForExactTokens',
[]: 'exactInput',
[]: 'exactOutput',
[]: 'swapExactTokensForTokensTJ',
[]: 'swapTokensForExactTokensTJ',
[]: 'swapExactAVAXForTokens',
[]: 'swapTokensForExactAVAX',
[]: 'swapExactTokensForAVAX',
[]: 'swapAVAXForExactTokens',
}