Summary
In @opensea/sdk 12.9.0, Arc and Stable Chain default offer currencies are documented and configured as 6-decimal ERC-20 mirrors, but both SDK constructors seed their decimal cache with 18 for every default offer token.
That cache is consulted before token metadata, so an offer amount such as 1.5 is converted to 1500000000000000000 instead of 1500000. This affects both the ethers and viem entrypoints.
Minimal reproduction
const sdk = new OpenSeaSDK(provider, { chain: Chain.StableChain })
await (sdk as any)._getPriceParameters(
OrderSide.OFFER,
"0x779ded0c9e1022225f8e0630b35a9b54be713736",
"1.5",
)
// current: { basePrice: 1500000000000000000n }
// expected: { basePrice: 1500000n }
The same result occurs on Arc with 0x3600000000000000000000000000000000000000.
Root cause
src/sdk.ts and src/viem.ts initialize the default offer-token cache to 18 decimals unconditionally. The v12.9 chain helpers correctly select the 6-decimal mirrors, but the cached value prevents getPaymentToken from resolving their actual decimals.
Scope
A narrow fix is to use 6 decimals only for the Arc and Stable Chain default offer mirrors while preserving:
- 18 decimals for existing wrapped-native defaults
- 18-decimal native listing behavior
- metadata lookup for non-default ERC-20 payment tokens
- identical behavior across ethers and viem
I reproduced this offline on current main and have regression coverage for both chains and both entrypoints. I can open the focused patch if this is not already fixed in the private monorepo.
Summary
In
@opensea/sdk12.9.0, Arc and Stable Chain default offer currencies are documented and configured as 6-decimal ERC-20 mirrors, but both SDK constructors seed their decimal cache with 18 for every default offer token.That cache is consulted before token metadata, so an offer amount such as
1.5is converted to1500000000000000000instead of1500000. This affects both the ethers and viem entrypoints.Minimal reproduction
The same result occurs on Arc with
0x3600000000000000000000000000000000000000.Root cause
src/sdk.tsandsrc/viem.tsinitialize the default offer-token cache to 18 decimals unconditionally. The v12.9 chain helpers correctly select the 6-decimal mirrors, but the cached value preventsgetPaymentTokenfrom resolving their actual decimals.Scope
A narrow fix is to use 6 decimals only for the Arc and Stable Chain default offer mirrors while preserving:
I reproduced this offline on current
mainand have regression coverage for both chains and both entrypoints. I can open the focused patch if this is not already fixed in the private monorepo.