Skip to content

v12.5.0

Choose a tag to compare

@ryanio ryanio released this 09 Sep 19:16
· 10 commits to main since this release

What's Changed

extractLinkedWallets(accessToken) reads the linked_wallets claim, so a caller can see every wallet the token's account has registered rather than only the primary wallet claim.

import { extractLinkedWallets } from "@opensea/sdk"

declare const accessToken: string

const wallets: string[] = extractLinkedWallets(accessToken)
void wallets

The claim already contains the token's own wallet, so the result is the complete set. Do not concatenate it with extractWalletAddress, which would double the primary.

Note the two take different inputs, despite reading as a pair. extractLinkedWallets takes the encoded access token and decodes it for you. extractWalletAddress(claims) takes an already-decoded claims object and returns string | undefined:

import { extractWalletAddress } from "@opensea/sdk"

declare const claims: Record<string, unknown>

const primary: string | undefined = extractWalletAddress(claims)
void primary

extractLinkedWallets returns an empty array when the claim is absent or not an array, so an older token is not an error. Dedupe is exact rather than case folded: EVM addresses differing only by checksum casing are the same wallet, but folding case would also merge genuinely distinct base58 values.

Also picks up @opensea/api-types@0.10.0, where the blockchain address schemas publish as strings.

Full Changelog: v12.4.1...v12.5.0