seaport.getAssetBalance() throws: Unable to get current owner from smart contract
I am trying to use seaport.getAssetBalance(). It is throwing an error of: Unable to get current owner from smart contract.
This is an example of my code following the documentation.
const balances = await seaport.getAssetBalance({
accountAddress: '0x06e98b5030E4A4b43cF284af02EEb4dEBD5a52Aa',
asset: {
tokenAddress: addresses.ARTWORK_COLLECTION,
tokenId: assets[0].tokenId,
schemaName: 'ERC1155',
},
})
Please let me know if this issue is common with you.
Same over here. Don't understand a thing.
Ok, I switched to a different asset which is now ERC721, and getAssetBalance does work now. Before I also tried with an ERC1155. Question is now, how can we get balance for ERC1155 tokens?
any updates on this? it looks opensea bydefault mint to ERC1155 so this is currently an issue
I believe the issue comes from the fact that the ERC1155 schemas are basically all hosted on a single OpenSea contract (most likely always 0x495f947276749Ce646f68AC8c248420045cb7b5e). Seems to be really specific to when you used the OpenSea contract.
Somehow, the SDK doesn't seem to support this specific schema (which is their own contract, bad SDK).
The workaround I've found was to use the API directly and fetch all the user's tokens (via https://api.opensea.io/api/v1/assets?options) and then filter the asset.collection.name to match my collection. Unfortunately, the SDK is also useless here because it doesn't even have the getAssets method implemented (again, bad SDK).
This is a workaround but it was the best way I found to fetch the items.
So basically, the SDK should first and foremost handle the case where getAssetBalance is used on an OpenSea contract, probably allowing a collectionName would make sense here to filter the proper collection. It should also have an implementation of getAssets, just cause it's in the API.
same when using rinkeby chain
Hello, is everyone still getting this error? Is it still only with ERC1155 or just with rinkeby chain?
Checking in again, is this still an issue?
This is occurring for me, for an 1155 asset. Same error on both Rinkeby and Main.
the same to me. how to solve it?
再次检查,这仍然是一个问题吗?
yes,pls have a test.Im using windows 10,and nodejs version is 16.5.1 and [email protected]
DEPRECATED: Please use providerUtils.standardizeOrThrow() instead d:\OS\OpenseaAPI\node_modules\opensea-js\lib\sdk.js:2149 throw new Error("Unable to get current owner from smart contract"); ^
Error: Unable to get current owner from smart contract
at OpenSeaSDK.
[Done] exited with code=1 in 28.134 seconds
This is my code: try { const offer = await seaport.createBuyOrder({ asset: { tokenAddress:tokenAddress, tokenId:tokenId, schemaName:'ERC721' }, accountAddress:walletAddress, // Value of the offer, in units of the payment token (or wrapped ETH if none is specified): startAmount: 0.1, }) console.log(offer); } catch(err) { console.log(err); }
Has anyone figured the solution?