The Treaty of Sagauli (1816) favored the British. Nepal accepted a British Resident.