The United States, shortly before calling itself the United Colonies, and shortly before that calling itself the Continental Association was formed as a group of colonies in British North America with common grievances against the government in London that it initially directed to the King within, and backed by an embargo against much of the rest of, the Empire. That attempt to improve the government of their part of the Empire to their satsifaction failing, they subsequently declared and eventually secured independence.
Which is to say that while it didn’t change its name to the United States until it had decided to exit the Empire, the organization that became known as the United States was formed as an association and agenda within the British Empire.
More to the point, the US, while not a belligerent in the Opium Wars, was a participant in the unequal treaties imposed through them (and played “good cop” while the British and French used force after the treaties relating to the 2nd Opium War were signed to secure their ratification.)