Skip to content

Commit a640110

Browse files
Fix: Use correct function for listing payment token cache (#1831)
The listing payment token cache was incorrectly using getOfferPaymentToken() instead of getListingPaymentToken(). This caused the wrong token address to be cached for listings. This bug could lead to issues when listing payment tokens differ from offer payment tokens on certain chains.
1 parent dacda0a commit a640110

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sdk.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
import {
2929
getDefaultConduit,
3030
getOfferPaymentToken,
31+
getListingPaymentToken,
3132
getSeaportAddress,
3233
} from "./utils/utils";
3334

@@ -101,7 +102,9 @@ export class OpenSeaSDK {
101102

102103
// Cache decimals for offer and listing payment tokens to skip network request
103104
const offerPaymentToken = getOfferPaymentToken(this.chain).toLowerCase();
104-
const listingPaymentToken = getOfferPaymentToken(this.chain).toLowerCase();
105+
const listingPaymentToken = getListingPaymentToken(
106+
this.chain,
107+
).toLowerCase();
105108
this._cachedPaymentTokenDecimals[offerPaymentToken] = 18;
106109
this._cachedPaymentTokenDecimals[listingPaymentToken] = 18;
107110

0 commit comments

Comments
 (0)