[英]Sign transaction without broadcasting it with metamask (not using private key)
I'm trying to sign a transaction without broadcast using metamask.我正在尝试使用元掩码在不广播的情况下签署交易。 I have tried web3js and etherjs (eth_signTransaction) but neither worked.我已经尝试过 web3js 和 etherjs (eth_signTransaction),但都没有用。 How to do this?这该怎么做?
I think opensea is signing message and then using it for transaction.我认为 opensea 正在签署消息,然后将其用于交易。 How did they do this?他们是怎么做到的?
MetaMask - RPC Error: Method not supported MetaMask - RPC 错误:不支持的方法
const signedTx = await web3.eth.signTransaction(tx, accounts[0])
Error: signing transactions is unsupported (operation="signTransaction", code=UNSUPPORTED_OPERATION错误:不支持签署交易 (operation="signTransaction", code=UNSUPPORTED_OPERATION
const signedTx = await signer.signTransaction(tx)
Metamask currently does not support the RPC method that is used to sign transactions. Metamask 当前不支持用于签署交易的 RPC 方法。 See the GitHub issue discussing why they chose not to implement it: https://github.com/MetaMask/metamask-extension/issues/3475请参阅 GitHub 问题讨论为什么他们选择不实施它: https://github.com/MetaMask/metamask-extension/issues/3475
EDIT:编辑:
I think opensea is signing message and then using it for transaction.我认为 opensea 正在签署消息,然后将其用于交易。 How did they do this?他们是怎么做到的?
The way that OpenSea allows minting in a gasless manner is actually quite simple: they don't mint the NFT until it is purchased by somebody. OpenSea 允许以无气体方式铸造的方式实际上非常简单:他们不会铸造 NFT,直到有人购买它。 OpenSea then mints the NFT themselves, using an owner 'bypass' present in the contract it deploys. OpenSea 然后使用它部署的合约中存在的所有者“绕过”来自己铸造 NFT。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.