跳转到主要内容
Virtual Environments 允许您向虚拟网络发送交易。发送交易的过程与在真实网络上发送交易完全相同。 交易可以通过 Dashboard UI 或 RPC 发送。本页面向您展示如何使用这两种方法进行操作。

通过 RPC 发送

使用 eth_sendRawTransaction RPC 方法向您的 Virtual Environment 发送交易。 下面的示例展示了如何使用 Viem、Ethers.js 和 cURL 命令发送交易。这些代码片段无需修改即可运行。

从 Dashboard 发送

从 Dashboard 发送的交易将记录在 Virtual Environment 的状态中。这些交易无需签名,可以在 Virtual Environment 上的任意地址之间发送。 在 Explorer 视图中,单击右上角的 Send 图标以访问 Send Transaction 输入表单。

从合约页面发送

在 Virtual Environment 内的合约页面上,Read/Write 标签页会通过该 Virtual Environment 的 RPC 将 write 函数作为交易发送。这些交易无需签名,并会像其他交易一样记录到 Virtual Environment 的状态中。 Write sub-tab of the Read/Write tab on the WETH9 contract inside a Virtual Environment, with a selected sender address, Fund and View Portfolio buttons, and the expanded approve function showing its parameters and the Write and Simulate buttons

后续步骤