Skip to main content

参数

  • message: (必填) 签名数据
  • address: (必填) 地址

返回值

  • Signaturehex encoded bytes

async function personal_sign() {
    try {
      const signature = await window.ethereum.request({
        method: 'personal_sign',
        params: [message, address],
      });
      console.log('签名结果:', signature);
    } catch (error) {
      console.log('签名失败:', signature);
    }
}