发现https://eostoolkit.io/home年久失修,无奈自己写个scatter调用,配合cleos可以实现任意命令调用。

1、scatter导入硬件钱包账号

2、新建index.html,完整源码如下

<!DOCTYPE html>
<html lang="zh-cn">
<head><meta charset="UTF-8"><title>scatter离线签名</title><script src="https://cdn.scattercdn.com/file/scatter-cdn/js/latest/scatterjs-core.min.js"></script><script src="https://cdn.scattercdn.com/file/scatter-cdn/js/latest/scatterjs-plugin-eosjs.min.js"></script><script src="https://cdn.jsdelivr.net/npm/eosjs@16.0.9/lib/eos.min.js"></script>
</head>
<body>正在调用scatter..
<script>// Don't forget to tell ScatterJS which plugins you are using.
ScatterJS.plugins( new ScatterEOS() );// Networks are used to reference certain blockchains.
// They let you get accounts and help you build signature providers.
const network = {blockchain:'eos',protocol:'https',host:'nodes.get-scatter.com',port:443,chainId:'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
}// First we need to connect to the user's Scatter.
ScatterJS.scatter.connect('My-App').then(connected => {// If the user does not have Scatter or it is Locked or Closed this will return false;if(!connected) return false;const scatter = ScatterJS.scatter;// Now we need to get an identity from the user.// We're also going to require an account that is connected to the network we're using.const requiredFields = { accounts:[network] };scatter.getIdentity(requiredFields).then(() => {// Always use the accounts you got back from Scatter. Never hardcode them even if you are prompting// the user for their account name beforehand. They could still give you a different account.const account = scatter.identity.accounts.find(x => x.blockchain === 'eos');// You can pass in any additional options you want into the eosjs reference.const eosOptions = { expireInSeconds:60 };// Get a proxy reference to eosjs which you can use to sign transactions with a user's Scatter.const eos = scatter.eos(network, Eos, eosOptions);// ----------------------------// Now that we have an identity,// an EOSIO account, and a reference// to an eosjs object we can send a transaction.// ----------------------------// Never assume the account's permission/authority. Always take it from the returned account.const transactionOptions = { authorization:[`${account.name}@${account.authority}`] };const result = eos.transaction({actions: [{"account": "eosio","name": "linkauth","authorization": [{"actor": "aaaaaaaaaaa","permission": "active"}],"data": "500f75193bc969c40000000000ea305580d3355c5de94c44000000e02ae94c44"}]}).catch(error => {console.error(error);});console.log('Success =>', JSON.stringify(result));}).catch(error => {// The user rejected this request, or doesn't have the appropriate requirements.console.error(error);});
});
</script></body>
</html>

3、使用cleos命令配合参数-d -s生成未签名交易,拷贝交易里的actions替换掉代码里的actions

4、用浏览器打开index.html,这时候就会唤出scatter登录,然后授权,最后在硬件钱包点确认

转载于:https://my.oschina.net/u/1432928/blog/3071706

scatter配合硬件钱包实现EOS离线签名相关推荐

  1. NEO 交易所钱包开发之离线签名【区块链】JAVA

    2019独角兽企业重金招聘Python工程师标准>>> 前言: 在2019年的3月之前我对铺天盖地的"区块链"网络风暴,都只是一个耳朵进另一个就帮忙给丢了...可 ...

  2. 区块链钱包—BTC Java版离线签名交易

    对于离线交易不做过多解释~,说白了就是拿上一笔未发出交易记录进行私钥的签名然后广播到链上. 主要是对区块链离线交易进行utxo上链. 代码参考: https://gitee.com/DHing/sig ...

  3. HyperMate Pro硬件钱包全体验

    Hi 体验新鲜好物,吐槽反人类设计,这里是ChainNode测评. 我是本期好物体验官少秀. 2021年,沉寂已久的加密市场迎来了久违的牛市,大量新人入场的同时,怎样安全的"拿住" ...

  4. ChainNode测评:WOOKONG BioSolo硬件钱包 全体验

    哈喽大家好,欢迎收看本期的ChainNode测评. 我是巴比特陈小胖. 在这个特殊的日子里,小胖先祝大家鼠年大吉.财运滚滚.身体健康.万事如意. 体验新鲜好物,吐槽反人类设计. 本期测评我们带来了WO ...

  5. Eos离线密钥生成的PHP代码

    虽然EOS的密钥算法类似于比特币,但做了一些调整,定义了自己的格式.开发包EosTool包含了EOS离线密钥生成模块,可以不连接任何节点实现离线生成EOS密钥.本文将给出EOS离线密钥生成的PHP代码 ...

  6. 区块链硬件钱包常见问答

    Q:硬件钱包为何安全? A:离线存储私钥 -- 硬件钱包采用专用的加密芯片来存储密钥, 与互联网隔离.并且密钥无法从钱包中直接导出.断绝黑客通过网络入侵的途径.这样就算使用硬件钱包的电脑或者手机中病毒 ...

  7. 开源钱包_硬件钱包是否应该开源

    开源钱包 Coauthored by Lixin Liu and Patrick Kim 刘立新 和 帕特里克·金 合着 This article was written before the lau ...

  8. 数字人民币试点新场景多点开花,多品种“硬件钱包”触达平常百姓家

    一直以来,数字人民币试点受到广泛关注.继苏州数字人民币试点后,又有诸多测试消息披露,其中既有如苏州一样的大规模红包试点,也有小场景的专项测试.在这其中,北京.上海对数字人民币硬件钱包的探索无疑成为了全 ...

  9. 以太坊钱包开发系列3 - 展示钱包信息及发起签名交易

    最新内容会更新在主站深入浅出区块链社区 原文链接:使用 ethers.js 开发以太坊 Web 钱包 3 - 展示钱包信息及发起签名交易) 以太坊去中心化网页钱包开发系列,将从零开始开发出一个可以实际 ...

最新文章

  1. 设计模式之代理模式(Proxy)摘录
  2. 【Spring源码分析系列】bean的加载
  3. Java 编程的动态性,第 8 部分: 用代码生成取代反射--转载
  4. sql 获取本周周一和周日
  5. AI理论知识基础(26)-机器学习常见损失函数, 共轭梯度法(2)
  6. boost::mpl模块实现vector_c相关的测试程序
  7. error记录 | 不能将参数 1 从“const char [5]”转换为“LPCTSTR
  8. 【Computer Organization】The Core Design Thinking of single cycle CPU
  9. python distance matrix_机器学习中的距离盘点
  10. 2022深圳杯C题思路解析
  11. Android SDCard中写入文件
  12. 这个七夕,送你一份程序员教科书级别的告白指南
  13. AVD Android虚拟设备root教程
  14. 查看centos 的版本
  15. STM32中 1u 0u的含义
  16. 产业分析:2021中国股权投资动态
  17. 计算机网络之ip、子网掩码、网络号、主机号等概念解析
  18. 批量删除某网站上传的题库
  19. ASP.NET MVC3 快速入门
  20. iptables之nat表的学习和实验

热门文章

  1. 记一次清除浏览器广告的经历
  2. 写给未来的自己几句话
  3. NRF24LE1定时器中断(1ms、5ms、10ms、20ms)
  4. 如何一键将720云全景图原图下载到本地电脑里
  5. 一堂优秀学员吕智钊分享----HHR计划----直播课第二课
  6. invoke方法学习
  7. 2331. 计算布尔二叉树的值-深度优先遍历
  8. 超声波模块与舵机模块
  9. 文件共享两台电脑不同步
  10. Bishop的一篇文章