Repository navigation
feat: add action to list nfts on opensea (ts) - #261
Conversation
✅ Heimdall Review Status
|
|
The EstimateGasExecutionError bug was also fixed in #283. |
|
I improved the provider setup such that a default provider is used and a private key is sufficient to setup OpenseaActionProvider |
|
@phdargen please rebase onto latest master. The changes to action provider initialization LGTM |
@John-peterson-coinbase Done! |
427113e to
ef92687
Compare
|
@murrlincoln please let me know when you had the time to review, then I will rebase again if needed (seems things are moving quickly) |
CarsonRoscoe
left a comment
There was a problem hiding this comment.
Please rebase against main, there have been a lot of changes over the last two weeks. I want to make sure it's up to date for my testing
There was a problem hiding this comment.
One feature #325 had over this was its get_nfts_by_account action. I believe it is good for the agent to be able to read the NFTs.
Can you give your action provider the ability to read an accounts NFT holdings? I believe the action is just wrapping getNFTsByAccount function from the SDK's API
Added get_nfts_by_account action and tests. Also tested successfully with prompt. |
Why? What?
Adds new OpenseaActionProvider to handle interactions with opensea.
So far only one action is implemented (list_nft) that creates a listing on opensea.
Additional actions like accept/create offer may be added in the future.
This implementation uses the opensea-js sdk that is added as new dependency and requires an opensea api key (https://docs.opensea.io/reference/api-overview). The new action is added in the chatbot.ts example, only if an OPENSEA_API_KEY is set.
The OpenSea SDK requires an ethers signer which is created when initialising OpenseaActionProvider with the privateKey to the account holding the NFT. In the chatbot.ts example, I extract the privateKey from the CdpWalletProvider. This is a bit of a hack but I couldn't find a way to directly use a EvmWalletProvider to create a ethers signer. Suggestions are welcome.
What changed?
EstimateGasExecutionError: Execution reverted for an unknown reasonfor mint nft action, similar to the issue Call to estimateGas in prepareTransaction of CdpWalletProvider uses address 0 #238.Fixed after changing:
account: this.#publicClient.accounttoaccount: this.#address as0x${string}Network support
Checklist
How has it been tested?