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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| chain_id | number | ✓ | EVM Chain ID (e.g., 1 for Ethereum mainnet). |
| Parameter | Type | Description |
|---|---|---|
| contract_address | string | Hex 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
}
| ErrorType | Description |
|---|---|
| InvalidChainId | Unsupported or unknown chain_id value. |
| ExternalApiError | Error returned by 1inch external API. |
| InternalError | Unhandled internal error. |