UNPKG

@rarimo/swap

Version:

Internal tools that other Rarimo packages use to swap tokens.

78 lines (77 loc) 3.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { CONTRACT_BALANCE: function() { return CONTRACT_BALANCE; }, THIS_ADDRESS: function() { return THIS_ADDRESS; }, CALLER_ADDRESS: function() { return CALLER_ADDRESS; }, WRAPPED_CHAIN_TOKEN_SYMBOLS: function() { return WRAPPED_CHAIN_TOKEN_SYMBOLS; }, SWAP_COMMANDS_NAME_MAP: function() { return SWAP_COMMANDS_NAME_MAP; } }); const _shared = require("@rarimo/shared"); const _enums = require("../enums"); const CONTRACT_BALANCE = '0x8000000000000000000000000000000000000000000000000000000000000000'; const THIS_ADDRESS = '0x0000000000000000000000000000000000000001'; const CALLER_ADDRESS = '0x0000000000000000000000000000000000000002'; const IDS = _shared.EVM_CHAIN_IDS; const WRAPPED_CHAIN_TOKEN_SYMBOLS = { // Ethereum [IDS[_shared.ChainNames.Ethereum]]: 'WETH', [IDS[_shared.ChainNames.Goerli]]: 'WETH', // Polygon [IDS[_shared.ChainNames.Polygon]]: 'WMATIC', // Avalanche [IDS[_shared.ChainNames.Avalanche]]: 'WAVAX', [IDS[_shared.ChainNames.Fuji]]: 'WAVAX', // BSC [IDS[_shared.ChainNames.BinanceSmartChain]]: 'WBNB', [IDS[_shared.ChainNames.Chapel]]: 'WBNB' }; const SWAP_COMMANDS_NAME_MAP = { [_enums.SwapCommands.BridgeErc20]: 'bridgeERC20', [_enums.SwapCommands.BridgeErc721]: 'bridgeERC721', [_enums.SwapCommands.BridgeErc1155]: 'bridgeERC1155', [_enums.SwapCommands.BridgeNative]: 'bridgeNative', [_enums.SwapCommands.TransferErc20]: 'transferERC20', [_enums.SwapCommands.TransferErc721]: 'transferERC721', [_enums.SwapCommands.TransferErc1155]: 'transferERC1155', [_enums.SwapCommands.TransferNative]: 'transferNative', [_enums.SwapCommands.TransferFromErc20]: 'transferFromERC20', [_enums.SwapCommands.TransferFromErc721]: 'transferFromERC721', [_enums.SwapCommands.TransferFromErc1155]: 'transferFromERC1155', [_enums.SwapCommands.WrapNative]: 'wrap', [_enums.SwapCommands.UnwrapNative]: 'unwrap', [_enums.SwapCommands.Multicall]: 'multicall', [_enums.SwapCommands.SwapExactTokensForTokensV2]: 'swapExactTokensForTokensV2', [_enums.SwapCommands.SwapTokensForExactTokensV2]: 'swapTokensForExactTokensV2', [_enums.SwapCommands.SwapExactEthForTokens]: 'swapExactETHForTokens', [_enums.SwapCommands.SwapTokensForExactEth]: 'swapTokensForExactETH', [_enums.SwapCommands.SwapExactTokensForEth]: 'swapExactTokensForETH', [_enums.SwapCommands.SwapEthForExactTokens]: 'swapETHForExactTokens', [_enums.SwapCommands.ExactInput]: 'exactInput', [_enums.SwapCommands.ExactOutput]: 'exactOutput', [_enums.SwapCommands.SwapExactTokensForTokensTj]: 'swapExactTokensForTokensTJ', [_enums.SwapCommands.SwapTokensForExactTokensTj]: 'swapTokensForExactTokensTJ', [_enums.SwapCommands.SwapExactAvaxForTokens]: 'swapExactAVAXForTokens', [_enums.SwapCommands.SwapTokensForExactAvax]: 'swapTokensForExactAVAX', [_enums.SwapCommands.SwapExactTokensForAvax]: 'swapExactTokensForAVAX', [_enums.SwapCommands.SwapAvaxForExactTokens]: 'swapAVAXForExactTokens' }; //# sourceMappingURL=swap-contract.js.map