Closed walruzperil closed 1 year ago
I also need to be able to do this. Does this sdk even support EIP-1559 transactions?
It would be good to get some clarification on this. Has anyone managed to set a higher gas price in fulfillOrder
?
Is there some workaround for setting max priority fee?
not here, but there is a solution. there are many bots out there executing with faster than average gas price. not sure if they are going directly through web3 or if they have figured out how to change code here. i have tried both gasPriceAddition and gasIncreaseFactor, neither work. is there a way to hardcode the the transaction data gas?
Was anyone able to go around this problem using the SDK?
I have a fork https://github.com/hack3r-0m/opensea-js/commit/44feced07439ee48d9b07aa83fc83feb03ac7e1e which returns abi encoded transaction data, you can then send that transaction using ethers.js
I have a fork hack3r-0m@44feced which returns abi encoded transaction data, you can then send that transaction using ethers.js
Thanks. Will give it a try! Just adding your encoded transaction data to the sendTransaction would be enough then, is that it?
(async () => {
const order = await seaport.api.getOrder({ side: OrderSide.Sell, asset_contract_address: asset_contract_address, token_id: token_id })
const abiEncoded = await seaport.fulfillOrder({ order, accountAddress: wallet.address })
const txn = {
to: wyvern,
type: 2,
data: abiEncoded.encoded,
value: ethers.BigNumber.from(abiEncoded.txnData.value.toString()),
maxPriorityFeePerGas: ethers.utils.parseUnits(additionalGas, "gwei"),
maxFeePerGas: ethers.utils.parseUnits(baseGas, "gwei") + ethers.utils.parseUnits(additionalGas, "gwei")
}
try {
const response = await wallet.sendTransaction(txn)
console.log(response)
} catch (e) {
console.log(e.name)
console.log(e.message)
}
})();
thanks a lot. works great!
Thanks, do you have a version for OpenSeaJS 2.0.1?
Great, your skill is unparalleled. May i have a question that how could i use it? Sorry, I can only use opensea-js . I don't know how to modify opensea-js module. pay high tribute to you
Any news on this?
(async () => { const order = await seaport.api.getOrder({ side: OrderSide.Sell, asset_contract_address: asset_contract_address, token_id: token_id }) const abiEncoded = await seaport.fulfillOrder({ order, accountAddress: wallet.address }) const txn = { to: wyvern, type: 2, data: abiEncoded.encoded, value: ethers.BigNumber.from(abiEncoded.txnData.value.toString()), maxPriorityFeePerGas: ethers.utils.parseUnits(additionalGas, "gwei"), maxFeePerGas: ethers.utils.parseUnits(baseGas, "gwei") + ethers.utils.parseUnits(additionalGas, "gwei") } try { const response = await wallet.sendTransaction(txn) console.log(response) } catch (e) { console.log(e.name) console.log(e.message) } })();
Where I can find what wyvern
variable is stands for?
(async () => { const order = await seaport.api.getOrder({ side: OrderSide.Sell, asset_contract_address: asset_contract_address, token_id: token_id }) const abiEncoded = await seaport.fulfillOrder({ order, accountAddress: wallet.address }) const txn = { to: wyvern, type: 2, data: abiEncoded.encoded, value: ethers.BigNumber.from(abiEncoded.txnData.value.toString()), maxPriorityFeePerGas: ethers.utils.parseUnits(additionalGas, "gwei"), maxFeePerGas: ethers.utils.parseUnits(baseGas, "gwei") + ethers.utils.parseUnits(additionalGas, "gwei") } try { const response = await wallet.sendTransaction(txn) console.log(response) } catch (e) { console.log(e.name) console.log(e.message) } })();
Where I can find what
wyvern
variable is stands for?
nvm, I've understood
})();
Could you get this to work with the new contract? I can't seem to get it
Hey, is everyone still having issue with this?
we really need EIP-1559 support to be added to the library (not limited to fulfilorder, but needed to be extended to all transactional operations)
(async () => { const order = await seaport.api.getOrder({ side: OrderSide.Sell, asset_contract_address: asset_contract_address, token_id: token_id }) const abiEncoded = await seaport.fulfillOrder({ order, accountAddress: wallet.address }) const txn = { to: wyvern, type: 2, data: abiEncoded.encoded, value: ethers.BigNumber.from(abiEncoded.txnData.value.toString()), maxPriorityFeePerGas: ethers.utils.parseUnits(additionalGas, "gwei"), maxFeePerGas: ethers.utils.parseUnits(baseGas, "gwei") + ethers.utils.parseUnits(additionalGas, "gwei") } try { const response = await wallet.sendTransaction(txn) console.log(response) } catch (e) { console.log(e.name) console.log(e.message) } })();
Could someone please explain what wyvern
is stands for? It isn't clear how to get this address (@hack3r-0m, @Verrok)
Btw, there's maybe a small issue with big numbers addition, because
const maxFeePerGas = ethers.utils.parseUnits(baseGas, "gwei") + ethers.utils.parseUnits(additionalGas, "gwei";
and
const maxFeePerGas = ethers.utils.parseUnits(`${baseGas + additionalGas}`, "gwei");
is not the same (in my case, the second option is working while the first isn't)
wyvern is the contract address of Opensea's Wyvern Exchange Protocol
The transaction to wyvern with the returned abi encoded data keeps failing. I compared the returned abi with the original hex data when buying through OS and it doesn't match.
I have a fork hack3r-0m@44feced which returns abi encoded transaction data, you can then send that transaction using ethers.js
How can I make this same change on my code?
@hack3r-0m Thanks for the code, do you happen to have a version which works with the new Opensea-js contracts by any chance?
wallet.sendTransaction(
Sry for long reply, I've replaced wyvern
with invoking seaport.api.getOrderCreateWyvernExchangeAddress()
(async () => { const order = await seaport.api.getOrder({ side: OrderSide.Sell, asset_contract_address: asset_contract_address, token_id: token_id }) const abiEncoded = await seaport.fulfillOrder({ order, accountAddress: wallet.address }) const txn = { to: wyvern, type: 2, data: abiEncoded.encoded, value: ethers.BigNumber.from(abiEncoded.txnData.value.toString()), maxPriorityFeePerGas: ethers.utils.parseUnits(additionalGas, "gwei"), maxFeePerGas: ethers.utils.parseUnits(baseGas, "gwei") + ethers.utils.parseUnits(additionalGas, "gwei") } try { const response = await wallet.sendTransaction(txn) console.log(response) } catch (e) { console.log(e.name) console.log(e.message) } })();
Where I can find what
wyvern
variable is stands for?
Hi, i tried 20 hours this code. My all code below list. This code bought nft but not change gas setting. Please help to me
const Web3 = require('web3'); const express = require('express'); const opensea = require("opensea-js"); const BigNumber = require('bignumber.js'); const from = require('from'); const OrderSide = require("opensea-js/lib/types"); const http = require('http'); const OpenSeaPort = opensea.OpenSeaPort; const Network = opensea.Network; const EventType = opensea.EventType; const ethers = require("ethers");
const privateKey = (walletprivatekey).toString('hex'); const wallet = new ethers.Wallet(privateKey);
const address = wallet.address; console.log("Public Address:", address);
(async () => {
let provider = new HDWalletProvider(walletprivatekey, "https://mainnet.infura.io/v3/MYINFURAKEYINHERE"); const web3 = new Web3(provider); web3.setProvider(provider);
const seaport = new OpenSeaPort(provider, { networkName: Network.Main, apiKey: "MYOPENSEAAPIKEYINHERE" }
let estimatedGasPrice = (await seaport._computeGasPrice()).toString()/1e9*2 seaport.gasPriceAddition = estimatedGasPrice;
console.log(estimatedGasPrice);
const order = await seaport.api.getOrder({ side: 1, asset_contract_address: asset_contract_address, token_id: token_id }) console.log(order); const abiEncoded = await seaport.fulfillOrder({ order, accountAddress: walletno, gasMultiplier: 4 })
const txn = { to: wyvern, type: 2, data: abiEncoded.encoded, value: ethers.BigNumber.from(abiEncoded.txnData.value.toString()), gasLimit: "500000", // basic transaction costs exactly 21000 maxPriorityFeePerGas: ethers.utils.parseUnits('150','gwei'), // Recommended maxPriorityFeePerGas maxFeePerGas: ethers.utils.parseUnits('170','gwei') // Recommended maxFeePerGas }
try {
console.log("geliyor");
const response = await wallet.sendTransaction(txn)
console.log(response)
} catch (e) {
console.log(e.name)
console.log(e.message)
}
})();
@hack3r-0m since atomic match has been relegated to legacy due to the implementation of the new seaport protocol, is there a way to get abiencoded data from the new seaport fulfillorder method? I managed to get the arguments before transaction is made: however i don't know how to convert that into this:
@hack3r-0m since atomic match has been relegated to legacy due to the implementation of the new seaport protocol, is there a way to get abiencoded data from the new seaport fulfillorder method? I managed to get the arguments before transaction is made: however i don't know how to convert that into this:
Do you solve this problem?
@hack3r-0m since atomic match has been relegated to legacy due to the implementation of the new seaport protocol, is there a way to get abiencoded data from the new seaport fulfillorder method? I managed to get the arguments before transaction is made: however i don't know how to convert that into this:
Do you solve this problem?
No, still haven't figured out. Unfortunately i'll be just using just the normal fulfillOrder for now without the ability to adjust gas settings. But hopefull someone will explain to us how to adjust gas settings with the new Seaport Contract.
@hack3r-0m since atomic match has been relegated to legacy due to the implementation of the new seaport protocol, is there a way to get abiencoded data from the new seaport fulfillorder method? I managed to get the arguments before transaction is made: however i don't know how to convert that into this:
How were you able to get the list of args?
Any news on this issue? I really need to be able to set the gas params.
You need to reconstitute the order and send it using ethers.js
On 30 Aug 2022, at 18:45, Nicolau Riess @.***> wrote:
Any news on this issue? I really need to be able to set the gas params.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
Hi, still no solution with the new version? The abiEncoded is not working anymore with ethers.js
We need someone to make a wrapper for this overcomplicated library. Simply:
list() bid() acceptOffer() etc.
Re controlling the gas, download the source of opensea-js and look for the references to seaport-js. Instead of assuming the reference as a dependency, get seaport-js from ProjectOpenSea's repo, and compile it yourself (https://github.com/ProjectOpenSea/seaport-js). You can update the references in opensea-js to seaport-js instead of the default packaged dependency. i.e. to your compiled (e.g. yarn tsc in the root folder of seaport-js) ( in sdk.ts change import { Seaport } from "@opensea/seaport-js";
to import { Seaport } from "./seaport-js/src/seaport";
or wherever you placed the seaport-js code). Then you can peep into the code that creates the fulfillOrder and update it to give you just the order params.
any news for new version opensea-js, seaport.fulfillOrder still send transaction in Legacy type)
Any update on this? The code no longer works (returns a 404)
Managed to get a workaround working with the Opensea Graph QL API.
Finally I was able to send a transaction with Max priority and maxFeePerGas
Finally I was able to send a transaction with Max priority and maxFeePerGas!)
Very nice! Can you explain it? Thanks <3
Finally I was able to send a transaction with Max priority and maxFeePerGas
Can you give me some hints I've been stuck with it for days
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.
Since EIP-1559 need setup Max priority fee. By default it set 1 i think. How we can increase Max priority fee?