Skip to content

fix(sdk): use six decimals for Arc and Stable Chain offers - #2013

Closed
Osraka wants to merge 1 commit into
ProjectOpenSea:mainfrom
Osraka:osraka/fix-new-chain-offer-decimals
Closed

Osraka wants to merge 1 commit into
ProjectOpenSea:mainfrom
Osraka:osraka/fix-new-chain-offer-decimals

Conversation

@Osraka

@Osraka Osraka commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

Closes #2012.

v12.9.0 adds Arc and Stable Chain offers through 6-decimal ERC-20 mirrors. Both SDK entrypoints still seed every default offer currency as 18 decimals, so 1.5 becomes 1500000000000000000 base units instead of 1500000. Because the address is already cached, the SDK never asks the payment-token endpoint for the correct precision.

The regression reproduces on current main for both chains and both ethers and viem.

Solution

Add the default offer currency precision to the chain helpers and use it when the ethers and viem constructors initialize their caches. Existing wrapped-native defaults remain at 18 decimals; native listing and non-default ERC-20 resolution are unchanged.

Regression coverage checks:

  • Arc and Stable Chain convert 1.5 offers to 1500000n
  • ethers and viem follow the same path
  • the known default does not require a metadata request
  • existing 18-decimal defaults remain unchanged

Validation:

  • npm test (57 files, 1,264 tests)
  • npm run check-types
  • npm run build
  • npm run format:check
  • npm run lint (passes with the existing unrelated Function warning)

@ryanio

ryanio commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Osraka, confirmed and fixed. This repo is a read-only mirror, so we recreated the fix internally with a shared per-chain table for stablecoin-mirror offer currencies (covers ethers and viem, credited to you in the release notes). It ships in @opensea/sdk 12.9.1. Closing this PR and #2012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arc and Stable Chain offers are scaled with 18 decimals

2 participants