Closed carver closed 2 years ago
I got some advice in Discord to update:
const offer = await seaport.createBuyOrder({
tokenId,
tokenAddress,
accountAddress,
to:
const offer = await seaport.createBuyOrder({
asset: {
tokenId,
tokenAddress
},
accountAddress,
But I'm seeing the same console error
@carver I think this is an issue with persona_sign in your provider. the command-line tooling for signing is extremely primitive and fragile right now. I recommend using
const MnemonicWalletSubprovider = require('@0x/subproviders').MnemonicWalletSubprovider
const RPCSubprovider = require('web3-provider-engine/subproviders/rpc')
const Web3ProviderEngine = require('web3-provider-engine')
See https://github.com/ProjectOpenSea/opensea-creatures/blob/master/scripts/sell.js
So I'm a little hard-headed and really wanted the IPC version to work. Eventually, I was able to add an id
to the outbound request, and it looks like that worked. (The only quirk being that the taker
on the bid is set to 0x0000..., but the bid is showing up fine in the UI).
I'll leave this open. It would be nice for the library to work with accounts in local nodes like geth
. If you want I can come back after Devcon and open a PR.
a taker of 0x0000... means that anyone can accept it, so that's fine. what do you mean about adding an id
? which request, the eth rpc request? would your PR be on opensea-js or on Web3
? currently we do
web3.currentProvider.sendAsync({
method: 'personal_sign',
params: [message, signerAddress],
from: signerAddress,
})
to do signatures, which is missing these params in the typescript lib:
id: number;
jsonrpc: string;
could that be the issue?
would your PR be on opensea-js or on
Web3
?
It would be on opensea-js
currently we do
web3.currentProvider.sendAsync({ method: 'personal_sign', params: [message, signerAddress], from: signerAddress, })
to do signatures, which is missing these params in the typescript lib:
id: number; jsonrpc: string;
could that be the issue?
Yup, exactly. I added an id
value to that message (I just hacked it into the installed opensea-js node module :see_no_evil: ), and that fixed the error message in the title.
@carver great, will fix that in the next version, coming this week
Open file node_modules/opensea-js/lib/utils/utils.js.
change web3.currentProvider.sendAsync to window.web3.currentProvider.sendAsync.
restart app
hope can help
I am trying to write a node.js script to place a buy order on a token. When I run it, I get:
Here is the code that is trying to place the offer:
If the token ID and account address are important, I am happy to side-channel them. (I'm on the Discord server)
I know that the account is unlocked and connected correctly, because if I run this I see a signed message:
Some environment info: