小编Sha*_*han的帖子

如何使用炼金术发送已经铸造的 NFT

我在 opensea 上铸造了一些 NFT。这些位于 Polygon 孟买网络上。现在我想使用alchemy web3将这些token转移到其他地址。这是我正在使用的代码。

\n

注意:这应该在 Nodejs Restful API 中运行,因此没有可用的钱包,这就是我手动签署交易的原因。

\n
async function main() {\n  require('dotenv').config();\n  const { API_URL,API_URL_TEST, PRIVATE_KEY } = process.env;\n  const { createAlchemyWeb3 } = require("@alch/alchemy-web3");\n  const web3 = createAlchemyWeb3(API_URL_TEST);\n  const myAddress = '*************************'\n  const nonce = await web3.eth.getTransactionCount(myAddress, 'latest');\n  const transaction = { //I believe transaction object is not correct, and I dont know what to put here\n      'asset': {\n        'tokenId': '******************************',//NFT token id in opensea\n      },\n      'gas': 53000,\n      'to': '***********************', //metamask …
Run Code Online (Sandbox Code Playgroud)

node.js smartcontracts web3js nft opensea

5
推荐指数
1
解决办法
1775
查看次数

标签 统计

nft ×1

node.js ×1

opensea ×1

smartcontracts ×1

web3js ×1