ProjectOpenSea / opensea-js

TypeScript SDK for the OpenSea marketplace
https://docs.opensea.io/reference
MIT License
2.27k stars 961 forks source link

Use ethers.Signer.getAddress() in OpenSeaSDK._getAvailableAccounts() #1491

Closed RLaursen closed 3 weeks ago

RLaursen commented 1 month ago

Motivation

The SDK does not currently work with ethers.Signer objects without an address property. ethers.Signer objects may asynchronously retrieve their own address via the .getAddress() method, they do not always have an address property.

Solution

Fallback to calling .getAddress() in OpenSeaSDK._getAvailableAccounts

Open Questions

Are the added tests sufficient/desired?

ryanio commented 1 month ago

thanks for the PR! do you have an example of instantiating a signer that has getAddress()? also i don't think we need to modify the tests, just the src you included seems fine

RLaursen commented 1 month ago

thanks for the PR! do you have an example of instantiating a signer that has getAddress()? also i don't think we need to modify the tests, just the src you included seems fine

Here's an example from our SDK :)

https://docs.stardust.gg/typescript-sdk/signers/ethers-v6/sign-transaction

RLaursen commented 1 month ago

I added some secrets I used for local testing to my fork, required gha code-quality / test (pull_request) should pass now I think (I will burn them EOD though)

RLaursen commented 3 weeks ago

Is anything else required for this? @ryanio

ryanio commented 3 weeks ago

looks good to me! sorry for the delay, will prepare a release now