【问题标题】:How to connect phantom wallet by Solana Pay using Web3.js?如何使用 Web3.js 通过 Solana Pay 连接幻影钱包?
【发布时间】:2022-09-23 21:07:12
【问题描述】:

我正在尝试使用 Web3.js 从 Solana Pay 连接 Phantom 钱包但是我不断收到错误“未定义缓冲区”。如何解决这个问题?

注意:我没有使用 Nodejs。我正在尝试创建与 Web3.js 库的集成。

这是代码:

<script>
// The below is the code where I am getting the error



                    var transaction= new solanaWeb3.Transaction().add(
                        
                    );

</script>

    标签: javascript solana-web3js


    【解决方案1】:

    使用 solana/web3.js v1.30.2

    或者为最新版本安装一些额外的依赖项

    我正在分享一个博客。它基于 ReactJS 但希望你能理解。 没问题,只需将您的版本更改为 1.30.2 即可。

    Blog_for_extra_dependencies

    您也可以参考此代码。 CodeSandbox

    【讨论】:

      猜你喜欢
      • 2022-08-05
      • 2021-12-09
      • 2022-06-27
      • 2021-09-15
      • 2021-09-18
      • 2021-12-28
      • 2021-09-10
      • 1970-01-01
      • 2021-12-20
      相关资源
      最近更新 更多