Foreign currency was officially considered legal tender in the United States during the first half of the 19th century after Congress passed a statute in 1806. The practice continued until it was discontinued by the the Coinage Act of 1857. The Act also specifies the rate of exchange for coins from different countries.
This Crooked Lake Review article re-published coin conversion tables from the 1849-50 Rochester City Directory, showing an English shilling at 0.23 cents. According to the article, "Each merchant would have to be a numismatist to recognize each of these foreign coins. To make things a bit easier, merchants could buy coin-weighing scales with the counter weights in the shape of, and bearing the same devices as, the actual foreign coins they were to be weighing."
Published in 1851, the events of the book (even though it's told as happening "some years ago") would have taken place precisely in this timeframe.
I'm a numismatist (coin collector) so I can answer your question. The US Mint was founded in 1792. However, the Mint did not have enough resources (gold, silver) to produce sufficient coinage to satisfy commerce. During colonial times, Americans bought goods with foreign coins. The colonists used British, French, Dutch, and Spanish coins. The most popular coin among the colonists is the Spanish 8 Reales. The 8 Reales had many nicknames: Milled Dollar, Pillar Dollar, Cob, Pieces of Eight etc. The Spanish 8 Reales was the inspiration behind the US silver dollar. The US silver dollar and Spanish 8 Reales both contained 27 grams of pure silver. The dollar sign $ originated from the "Pillars of Hercules" design on the 8 Reales. Even after the establishment of the US Mint, American citizens continued to pay with Spanish 8 Reales. In fact, the 8 Reales was more popular with Americans than coins made by the US Mint! The Spanish 8 Reales continued to be legal tender in the US until the Civil War. Here is a picture of a 8 Reales from my collection: https://imgur.com/a/V0PfC
In 1804, Thomas Jefferson suspended the minting of silver dollars. Jefferson halted the production of silver dollars because most silver dollars were being exported out of the US in exchange for Spanish 8 Reales. Thus the US Mint focused on minting smaller denomination coins. With the suspension of silver dollars, the half dollar became the most popular coin in commerce. Most debts or large transactions were paid with large bags of half dollars. Here is a picture of a 1832 half dollar: https://imgur.com/a/659hd
In 1799 the US had it's first gold rush, the Carolina Gold Rush. With the discovery of gold in North Carolina, Andrew Jackson established a mint in the city of Charlotte. The Charlotte Mint converted locally mined gold into coins. A few decades later, an even bigger gold rush occurred in California. The California Gold Rush led to the formation of the San Francisco Mint. In addition, vast silver deposits were discovered at the Comestock Lode in Nevada. A mint in Carson City was established to convert the ore into silver dollars. With the discovery of various precious metal deposits, America became less reliant on foreign coins. Here is a picture of a 1874 gold dollar: https://imgur.com/a/DSeXW