On this page

1inch v6.0 Classic Swap Contract

API-v21inch_v6_0_classic_swap_contract

The 1inch_v6_0_classic_swap_contract method returns the router (spender) contract address that must be approved before executing a Classic Swap through 1inch API v6.0.

To use 1 inch integration methods you must set 1inch_api in your MM2.json configuration and provide a valid API key via the ONE_INCH_API_TEST_AUTH environment variable.

Refer to the 1inch Classic Swap docs for further information.

ParameterTypeRequiredDescription
chain_idnumberEVM Chain ID (e.g., 1 for Ethereum mainnet).

ParameterTypeDescription
contract_addressstringHex address of the 1inch router contract for the specified chain.

POST
1inch_v6_0_classic_swap_contract
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "1inch_v6_0_classic_swap_contract",
  "params": {
    "chain_id": 1
  },
  "id": 0
}

ErrorTypeDescription
InvalidChainIdUnsupported or unknown chain_id value.
ExternalApiErrorError returned by 1inch external API.
InternalErrorUnhandled internal error.