网络变更消息

消息 ID:setNode

概述

开发人员可以监视此消息以了解网络变化。此消息在以下情况下生成:

  1. 当用户更换网络时

规格

例子复制

window.addEventListener('message', function (e) {
  if (e.data.message && e.data.message.action == "setNode") {
    // handler logic
    console.log('got setNode event', e.data)
  }
})

返回复制

{
  "node": {
    // Information about the current network
  },
  "connectNode": {
    // Node information of DApp chain
  }
}

Comments

No comments yet. Why don’t you start the discussion?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注