opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

Max priority fee EIP-1559

Open walruzperil opened this issue 5 years ago • 39 comments

Since EIP-1559 need setup Max priority fee. By default it set 1 i think. How we can increase Max priority fee?

walruzperil avatar Sep 02 '21 15:09 walruzperil

I also need to be able to do this. Does this sdk even support EIP-1559 transactions?

overfocus avatar Oct 05 '21 07:10 overfocus

It would be good to get some clarification on this. Has anyone managed to set a higher gas price in fulfillOrder ?

nedosa avatar Oct 17 '21 09:10 nedosa

Is there some workaround for setting max priority fee?

theboxer avatar Oct 25 '21 13:10 theboxer

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?

workhard9999 avatar Oct 31 '21 17:10 workhard9999

Was anyone able to go around this problem using the SDK?

nmduarteus avatar Jan 22 '22 18:01 nmduarteus

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

hack3r-0m avatar Jan 22 '22 23:01 hack3r-0m

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?

nmduarteus avatar Jan 23 '22 10:01 nmduarteus

(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)
    }

})();

hack3r-0m avatar Jan 23 '22 10:01 hack3r-0m

thanks a lot. works great!

nmduarteus avatar Jan 23 '22 21:01 nmduarteus

Thanks, do you have a version for OpenSeaJS 2.0.1?

emorling avatar Feb 23 '22 22:02 emorling

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

skyonedot avatar Feb 27 '22 05:02 skyonedot

Any news on this?

emorling avatar Feb 28 '22 15:02 emorling

(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?

Verrok avatar Mar 03 '22 09:03 Verrok

(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

Verrok avatar Mar 03 '22 20:03 Verrok

})();

Could you get this to work with the new contract? I can't seem to get it

robotesteves avatar Mar 09 '22 04:03 robotesteves

Hey, is everyone still having issue with this?

esteban-OpenSea avatar Apr 19 '22 15:04 esteban-OpenSea

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)

simonare avatar Apr 22 '22 06:04 simonare

(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)

DavydenkovM avatar May 18 '22 20:05 DavydenkovM

wyvern is the contract address of Opensea's Wyvern Exchange Protocol

simonare avatar May 19 '22 09:05 simonare

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.

bernardovski avatar Jun 03 '22 14:06 bernardovski