From 6d86f38474bd83151a11b040a3edbb8228e1deb8 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 17 Sep 2018 14:17:14 +0800 Subject: [PATCH 01/54] Update README.md --- README.md | 82 ++++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index fbc6fc7..0c34338 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,11 @@ 版本:1.0 -协议最后更新:2018.8.31 - -English Version: https://github.com/southex/SimpleWallet/blob/master/README_en.md ( EOSShenzhen 翻译) +协议最后更新:2018.09.17 ## 简介 -SimpleWallet是一个EOS钱包和dapp的通用对接协议。 - -目前EOS的钱包应用众多、dapp也在快速发展中,在实际对接过程中,各方标准不统一,对接耗时耗力。 -遵照此协议,可以减少各方开发适配工作,低耦合的实现钱包对dapp进行登录授权和支付。 -钱包接入方可在 https://www.southex.com 进行在线测试。 - -## 协议发起方 -本协议由SouthEX起草,MeetOne、More、TokenPocket、KKWallet、HaloWallet 共同参与讨论和修改。 - -除以上五家钱包之外,目前正在接入的钱包商还包括:EOS LIVE钱包、番茄钱包、PocketEOS及韩国的coinus等。 +SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 -目前接入此协议的名单:https://github.com/southex/SimpleWallet/blob/master/supporter_list.md - -欢迎更多的钱包和dapp接入此协议,并向我们提交你们的产品信息。 ## 功能列表 - 登录 @@ -41,13 +27,31 @@ SimpleWallet是一个EOS钱包和dapp的通用对接协议。 以下为安卓端的协议接入方法: +#### Ethereum +拦截协议为:simplewallet://ethereum.io +#### EOS.IO 拦截协议为:simplewallet://eos.io dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: -simplewallet://eos.io?param={json数据} +#### Ethereum +拦截协议为:simplewallet://ethereum.io?param={json数据} +#### EOS.IO +拦截协议为:simplewallet://eos.io?param={json数据} + +以下为iOS端的协议接入方法(以麦子钱包为例): -对于iOS端,由于其app之间的调用机制和安卓差别很大,制定统一的协议非常复杂,且目前基于iOS的dapp和钱包很少,因此SimpleWallet不对iOS上进行协议统一。各方钱包和dapp可自行协商对接方法。 +#### Ethereum +拦截协议为:mathwallet://ethereum.io +#### EOS.IO +拦截协议为:mathwallet://eos.io + +dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: + +#### Ethereum +拦截协议为:mathwallet://ethereum.io?param={json数据} +#### EOS.IO +拦截协议为:mathwallet://eos.io?param={json数据} ### 2. 登录 @@ -65,6 +69,7 @@ simplewallet://eos.io?param={json数据} { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) dappName string // dapp名字 dappIcon string // dapp图标 action string // 赋值为login @@ -86,10 +91,11 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) timestamp number // 当前UNIX时间戳 - sign string // eos签名 + sign string // eos、ethereum签名 uuID string // dapp server生成的,用于此次登录验证的唯一标识 - account string // eos账户名 + account string // eos账户名、ethereum地址等 ref string // 来源,如钱包名 } ``` @@ -113,6 +119,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) dappName string // dapp名字,用于在钱包APP中展示 dappIcon string // dapp图标Url,用于在钱包APP中展示 action string // 赋值为login @@ -137,16 +144,17 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 from string // 付款人的EOS账号,可选 to string // 收款人的EOS账号,必须 amount number // 转账数量,必须 - contract string // 转账的token所属的contract账号名,必须 + contract string // 转账的token所属的contract账号名或地址,必须 symbol string // 转账的token名称,必须 precision number // 转账的token的精度,小数点后面的位数,必须 - dappData string // 由dapp生成的业务参数信息,需要钱包在转账时附加在memo中发出去,格式为:k1=v1&k2=v2,可选 + dappData string // 由dapp生成的业务参数信息,需要钱包在转账时附加在memo或data中发出去,格式为:k1=v1&k2=v2,可选 // 钱包转账时还可附加ref参数标明来源,如:k1=v1&k2=v2&ref=walletname desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 二维码过期时间,unix时间戳 @@ -155,8 +163,8 @@ sign = ecc.sign(data, privateKey) // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } ``` -- 钱包组装上述数据,生成一笔EOS的transaction,用户授权此笔转账后,提交转账数据到EOS主网;若有callback参数,则进行回调访问 -- dapp可根据callback中的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或dapp自行搭建节点监控EOS主网,检查代币是否到账 +- 钱包组装上述数据,生成一笔EOS或Ethereum的transaction,用户授权此笔转账后,提交转账数据到EOS或Ethereum主网;若有callback参数,则进行回调访问 +- dapp可根据callback中的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或dapp自行搭建节点监控EOS或Ethereum主网,检查代币是否到账 - 对于流行币种如IQ,如果二维码中给出的contract名和官方的合约名不一致,钱包方要提醒用户,做二次确认 - 钱包应该提醒用户注意辨别二维码的来源,避免被钓鱼攻击 @@ -170,16 +178,17 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) action string // 支付时,赋值为transfer dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - from string // 付款人的EOS账号,可选 - to string // 收款人的EOS账号,必须 + from string // 付款人的EOS账号或Ethereum地址,可选 + to string // 收款人的EOS账号或Ethereum地址,必须 amount number // 转账数量,必须 - contract string // 转账的token所属的contract账号名 + contract string // 转账的token所属的contract账号名或地址 symbol string // 转账的token名称,必须 precision number // 转账的token的精度,小数点后面的位数,必须 - dappData string // 由dapp生成的业务参数信息,需要钱包在转账时附加在memo中发出去,格式为:k1=v1&k2=v2,可选 + dappData string // 由dapp生成的业务参数信息,需要钱包在转账时附加在memo或data中发出去,格式为:k1=v1&k2=v2,可选 // 钱包转账时还可附加ref参数标明来源,如:k1=v1&k2=v2&ref=walletname desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=login,可选 @@ -187,8 +196,8 @@ sign = ecc.sign(data, privateKey) // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } ``` -- 钱包组装上述数据,生成一笔EOS的transaction,用户授权此笔转账后,提交转账数据到EOS主网;如果有callback,则回调拉起dapp的应用 -- dapp可根据callback里的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或自行搭建节点监控EOS主网,检查代币是否到账 +- 钱包组装上述数据,生成一笔EOS或Ethereum的transaction,用户授权此笔转账后,提交转账数据到EOS或Ethereum主网;如果有callback,则回调拉起dapp的应用 +- dapp可根据callback里的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或自行搭建节点监控EOS或Ethereum主网,检查代币是否到账 ### 错误处理 @@ -222,16 +231,3 @@ sign = ecc.sign(data, privateKey) * SimpleWallet协议为何不制定钱包和dapp之间的智能合约调用的标准? > 同上。 - - -## 更新说明 -- 9.6 - 增加了FAQ内容 -- 8.17 - 增加测试链接; - 支付操作中增加了callback参数; - 修改两个字段的命名,expire->expired,callbackUrl->callback -- 8.16 - 修改dapp的应用调用钱包APP时的callback,钱包只需要附加result结果即可,无需拼装action参数 -- 8.15 - 简化协议,取消info字段;增加desc字段,此字段是string类型,用来描述一个交易 From a2a422a7e8a48d521af582718d2d349bd157ae5d Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 17 Sep 2018 14:20:25 +0800 Subject: [PATCH 02/54] Update README.md --- README.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0c34338..d0fad89 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 钱包APP应在操作系统内注册拦截协议(URL Scheme、appLink),以便dapp的APP拉起钱包应用。 -以下为安卓端的协议接入方法: +以下为协议接入方法: #### Ethereum 拦截协议为:simplewallet://ethereum.io @@ -34,20 +34,13 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: +#### Android #### Ethereum 拦截协议为:simplewallet://ethereum.io?param={json数据} #### EOS.IO 拦截协议为:simplewallet://eos.io?param={json数据} -以下为iOS端的协议接入方法(以麦子钱包为例): - -#### Ethereum -拦截协议为:mathwallet://ethereum.io -#### EOS.IO -拦截协议为:mathwallet://eos.io - -dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: - +#### iOS(以麦子钱包为例) #### Ethereum 拦截协议为:mathwallet://ethereum.io?param={json数据} #### EOS.IO From 56127fa9f7d4fabf6099fe9b3af976ffaa9531ad Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 18 Sep 2018 11:28:15 +0800 Subject: [PATCH 03/54] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0fad89..8e960c5 100644 --- a/README.md +++ b/README.md @@ -141,8 +141,8 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 - from string // 付款人的EOS账号,可选 - to string // 收款人的EOS账号,必须 + from string // 付款人的EOS账号或Ethereum地址,可选 + to string // 收款人的EOS账号或Ethereum地址,必须 amount number // 转账数量,必须 contract string // 转账的token所属的contract账号名或地址,必须 symbol string // 转账的token名称,必须 From 4dad9f6c46745ff64f157cb82b812edecfa2d543 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 19 Sep 2018 16:22:22 +0800 Subject: [PATCH 04/54] Update README.md --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8e960c5..7401ca8 100644 --- a/README.md +++ b/README.md @@ -27,23 +27,16 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 以下为协议接入方法: -#### Ethereum +- Ethereum 拦截协议为:simplewallet://ethereum.io -#### EOS.IO +- EOS.IO 拦截协议为:simplewallet://eos.io dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: -#### Android -#### Ethereum -拦截协议为:simplewallet://ethereum.io?param={json数据} -#### EOS.IO -拦截协议为:simplewallet://eos.io?param={json数据} - -#### iOS(以麦子钱包为例) -#### Ethereum +- Ethereum 拦截协议为:mathwallet://ethereum.io?param={json数据} -#### EOS.IO +- EOS.IO 拦截协议为:mathwallet://eos.io?param={json数据} ### 2. 登录 From 489e55ba86b50587e37420c08e09e5b24c89302c Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 19 Sep 2018 16:25:27 +0800 Subject: [PATCH 05/54] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7401ca8..ea34cd9 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,19 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 以下为协议接入方法: -- Ethereum -拦截协议为:simplewallet://ethereum.io -- EOS.IO -拦截协议为:simplewallet://eos.io +- Ethereum 拦截协议(下面二选一) +> simplewallet://ethereum.io +> mathwallet://ethereum.io +- EOS.IO 拦截协议(下面二选一) +> simplewallet://eos.io +> mathwallet://eos.io dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: -- Ethereum -拦截协议为:mathwallet://ethereum.io?param={json数据} +- Ethereum +> mathwallet://ethereum.io?param={json数据} - EOS.IO -拦截协议为:mathwallet://eos.io?param={json数据} +> mathwallet://eos.io?param={json数据} ### 2. 登录 From 77d8393b15e3d77df17026edc00af250fb4416eb Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 19 Sep 2018 16:26:22 +0800 Subject: [PATCH 06/54] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ea34cd9..db45228 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,11 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 - Ethereum 拦截协议(下面二选一) > simplewallet://ethereum.io + > mathwallet://ethereum.io - EOS.IO 拦截协议(下面二选一) > simplewallet://eos.io + > mathwallet://eos.io dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: From 5be6ff10087cf6594b9bbc788a0e8dc74a018895 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 19 Sep 2018 16:27:38 +0800 Subject: [PATCH 07/54] Update README.md --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index db45228..4c949f4 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,14 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 以下为协议接入方法: - Ethereum 拦截协议(下面二选一) -> simplewallet://ethereum.io -> mathwallet://ethereum.io -- EOS.IO 拦截协议(下面二选一) -> simplewallet://eos.io +> simplewallet://ethereum.io?param={json数据} -> mathwallet://eos.io +> mathwallet://ethereum.io?param={json数据} -dapp的移动端应用可以调用此协议,传递数据给钱包APP,传递数据的请求格式为: +- EOS.IO 拦截协议(下面二选一) -- Ethereum -> mathwallet://ethereum.io?param={json数据} -- EOS.IO +> simplewallet://eos.io?param={json数据} > mathwallet://eos.io?param={json数据} ### 2. 登录 From 3a2c6a581608fbae87bf77ef937c771118f9cbf8 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 19 Sep 2018 16:36:43 +0800 Subject: [PATCH 08/54] Update README.md --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4c949f4..858607a 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 - EOS.IO 拦截协议(下面二选一) > simplewallet://eos.io?param={json数据} + > mathwallet://eos.io?param={json数据} ### 2. 登录 @@ -76,7 +77,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) timestamp number // 当前UNIX时间戳 sign string // eos、ethereum签名 uuID string // dapp server生成的,用于此次登录验证的唯一标识 @@ -104,12 +105,13 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) dappName string // dapp名字,用于在钱包APP中展示 dappIcon string // dapp图标Url,用于在钱包APP中展示 action string // 赋值为login uuID string // dapp生成的,用于dapp登录验证唯一标识 loginUrl string // dapp server生成的,用于接受此次登录验证的URL + expired number // 二维码过期时间,unix时间戳 loginMemo string // 登录的备注信息,钱包用来展示,可选 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=login,可选 // 钱包回调时在此URL后加上操作结果(&result),如:appABC://abc.com?action=login&result=1, @@ -129,12 +131,12 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 - from string // 付款人的EOS账号或Ethereum地址,可选 - to string // 收款人的EOS账号或Ethereum地址,必须 + from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,可选 + to string // 收款人的EOS账号、EOSForce账号或Ethereum地址,必须 amount number // 转账数量,必须 contract string // 转账的token所属的contract账号名或地址,必须 symbol string // 转账的token名称,必须 @@ -142,14 +144,14 @@ sign = ecc.sign(data, privateKey) dappData string // 由dapp生成的业务参数信息,需要钱包在转账时附加在memo或data中发出去,格式为:k1=v1&k2=v2,可选 // 钱包转账时还可附加ref参数标明来源,如:k1=v1&k2=v2&ref=walletname desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - expired number // 二维码过期时间,unix时间戳 + expired number // 交易二维码过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如https://abc.com?action=login&qrcID=123,可选 // 钱包回调时在此URL后加上操作结果(result、txID),如:https://abc.com?action=login&qrcID=123&result=1&txID=xxx, - // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) + // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS、EOS原力或以太坊主网上该笔交易的id(若有) } ``` - 钱包组装上述数据,生成一笔EOS或Ethereum的transaction,用户授权此笔转账后,提交转账数据到EOS或Ethereum主网;若有callback参数,则进行回调访问 -- dapp可根据callback中的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或dapp自行搭建节点监控EOS或Ethereum主网,检查代币是否到账 +- dapp可根据callback中的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或dapp自行搭建节点监控EOS、EOS原力或Ethereum主网,检查代币是否到账 - 对于流行币种如IQ,如果二维码中给出的contract名和官方的合约名不一致,钱包方要提醒用户,做二次确认 - 钱包应该提醒用户注意辨别二维码的来源,避免被钓鱼攻击 @@ -175,7 +177,8 @@ sign = ecc.sign(data, privateKey) precision number // 转账的token的精度,小数点后面的位数,必须 dappData string // 由dapp生成的业务参数信息,需要钱包在转账时附加在memo或data中发出去,格式为:k1=v1&k2=v2,可选 // 钱包转账时还可附加ref参数标明来源,如:k1=v1&k2=v2&ref=walletname - desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=login,可选 // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=login&result=1&txID=xxx, // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) From b2c44d86c396a890d7d0efc58768a8038f642d92 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 19 Sep 2018 16:45:17 +0800 Subject: [PATCH 09/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 858607a..4520fa8 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ sign = ecc.sign(data, privateKey) action string // 赋值为login uuID string // dapp生成的,用于dapp登录验证唯一标识 loginUrl string // dapp server生成的,用于接受此次登录验证的URL - expired number // 二维码过期时间,unix时间戳 + expired number // 登录过期时间,unix时间戳 loginMemo string // 登录的备注信息,钱包用来展示,可选 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=login,可选 // 钱包回调时在此URL后加上操作结果(&result),如:appABC://abc.com?action=login&result=1, From 71a841d4ce8997b802e9a253bcdc2714e50cfc37 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 26 Sep 2018 16:35:25 +0800 Subject: [PATCH 10/54] Update README.md --- README.md | 40 +++++----------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 4520fa8..9f30a94 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,10 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 钱包APP应在操作系统内注册拦截协议(URL Scheme、appLink),以便dapp的APP拉起钱包应用。 以下为协议接入方法: +> mathwallet://mathwallet.org?param={json数据} -- Ethereum 拦截协议(下面二选一) - -> simplewallet://ethereum.io?param={json数据} - -> mathwallet://ethereum.io?param={json数据} - -- EOS.IO 拦截协议(下面二选一) - -> simplewallet://eos.io?param={json数据} - -> mathwallet://eos.io?param={json数据} +兼容之前的SimpleWallet协议 +> simplewallet://eos.io?param={json数据} ### 2. 登录 @@ -179,8 +171,8 @@ sign = ecc.sign(data, privateKey) // 钱包转账时还可附加ref参数标明来源,如:k1=v1&k2=v2&ref=walletname desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=login,可选 - // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=login&result=1&txID=xxx, + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 + // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transfer&result=1&txID=xxx, // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } ``` @@ -197,25 +189,3 @@ sign = ecc.sign(data, privateKey) error string //返回的提示信息 } ``` - -## FAQ - -* 如何避免用户扫描了伪造的二维码? - - > 虽然可以通过创建一个统一的dapp和钱包注册中心,通过白名单的方式来避免钓鱼,但这会使此协议更复杂、更中心化,从而也更脆弱。我们建议钱包商在界面上提醒用户注意识别二维码的来源,提高用户的安全意识,同时向用户展示签名的原始信息。 - -* 二维码的信息过多,可否增加压缩算法? - - > 我们进行过测试,能压缩20-30%左右,效果不算特别理想,因此协议中没有将压缩算法正式纳入。虽然二维码看起来过密,但钱包基本均可正常识别。我们建议,如果二维码信息过多,dapp在展示二维码的时候,适当加大尺寸,让用户不必将手机凑近屏幕,提高钱包的识别速度。 - -* 在验证登录信息的时候,dapp应该验证active还是owner的签名? - - > 我们建议dapp先验证active的签名,若不通过,再验证owner。对于钱包商来说,建议用active权限来签名。 - -* 对dapp内嵌到钱包里面的场景,SimpleWallet协议为何不制定相关登录和支付标准? - - > 目前多数钱包均在开发或已开发出自己的一套相关标准,统一标准的代价很大。我们建议各钱包商也参考scatter的方案来,这样会大大降低在web端已经接入了scatter的dapp们的适配成本。 - -* SimpleWallet协议为何不制定钱包和dapp之间的智能合约调用的标准? - - > 同上。 From e785e8804ecc8ab326475d31072d4400d3c7881a Mon Sep 17 00:00:00 2001 From: Forrest Date: Thu, 27 Sep 2018 17:25:33 +0800 Subject: [PATCH 11/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f30a94..3bf045e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) dappName string // dapp名字 dappIcon string // dapp图标 action string // 赋值为login From 85be3ec581326e24333bcd1723aae1760ed8f776 Mon Sep 17 00:00:00 2001 From: Forrest Date: Sat, 29 Sep 2018 14:15:24 +0800 Subject: [PATCH 12/54] Update README.md --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3bf045e..5310d79 100644 --- a/README.md +++ b/README.md @@ -179,10 +179,67 @@ sign = ecc.sign(data, privateKey) - 钱包组装上述数据,生成一笔EOS或Ethereum的transaction,用户授权此笔转账后,提交转账数据到EOS或Ethereum主网;如果有callback,则回调拉起dapp的应用 - dapp可根据callback里的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或自行搭建节点监控EOS或Ethereum主网,检查代币是否到账 +### 4. 交易体 +#### 场景1:钱包扫描二维码,执行Transaction +> Ethereum + 参考支付场景,dappData用来存放交易的Data数据。 + +> EOS、EOS原力 + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) + action string // 支付时,赋值为transaction + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + actions array // [{ + // "code": "eosio.token", + // "action": "transfer", + // "binargs":"00000" + // }] + account string // 要执行交易的账户 + desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + expired number // 交易过期时间,unix时间戳 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如https://abc.com?action=transaction&qrcID=123,可选 + // 钱包回调时在此URL后加上操作结果(result、txID),如:https://abc.com?action=transaction&qrcID=123&result=1&txID=xxx, + // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) +} + +``` +#### 场景2:dapp的移动端拉起钱包App,执行Transaction + +> Ethereum + 参考支付场景,dappData用来存放交易的Data数据。 + +> EOS、EOS原力 + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) + action string // 支付时,赋值为transaction + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + actions array // [{ + // "code": "eosio.token", + // "action": "transfer", + // "binargs":"00000" + // }] + account string // 要执行交易的账户 + desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + expired number // 交易过期时间,unix时间戳 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 + // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transaction&result=1&txID=xxx, + // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) +} + +``` ### 错误处理 - code不等于0则请求失败 -``` // 错误返回 { code number //错误符,等于0是成功,大于0说明请求失败,dapp返回具体的错误码 From d6081c7c3c68a3e688528886e4c8b737247032b3 Mon Sep 17 00:00:00 2001 From: Forrest Date: Sat, 29 Sep 2018 14:19:08 +0800 Subject: [PATCH 13/54] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5310d79..889f3d7 100644 --- a/README.md +++ b/README.md @@ -191,10 +191,10 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、ethereum等) action string // 支付时,赋值为transaction dappName string // dapp名字,用于在钱包APP中展示,可选 - dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 actions array // [{ // "code": "eosio.token", // "action": "transfer", @@ -203,7 +203,7 @@ sign = ecc.sign(data, privateKey) account string // 要执行交易的账户 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如https://abc.com?action=transaction&qrcID=123,可选 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如https://abc.com?action=transaction&qrcID=123,可选 // 钱包回调时在此URL后加上操作结果(result、txID),如:https://abc.com?action=transaction&qrcID=123&result=1&txID=xxx, // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } @@ -220,10 +220,10 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、ethereum等) action string // 支付时,赋值为transaction dappName string // dapp名字,用于在钱包APP中展示,可选 - dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 actions array // [{ // "code": "eosio.token", // "action": "transfer", From cee3f979bd15f1ff55a2ac9f10999c05fe8d763a Mon Sep 17 00:00:00 2001 From: Forrest Date: Sat, 29 Sep 2018 14:23:01 +0800 Subject: [PATCH 14/54] Update README.md --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 889f3d7..e365ece 100644 --- a/README.md +++ b/README.md @@ -196,10 +196,10 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 actions array // [{ - // "code": "eosio.token", - // "action": "transfer", - // "binargs":"00000" - // }] + "code": "eosio.token", + "action": "transfer", + "binargs":"00000" + }] account string // 要执行交易的账户 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 @@ -232,9 +232,8 @@ sign = ecc.sign(data, privateKey) account string // 要执行交易的账户 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 - // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transaction&result=1&txID=xxx, - // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 + // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transaction&result=1&txID=xxx, result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } ``` From dfe6bfb8909dbcd4c8905f87aa5cbd633cc582a4 Mon Sep 17 00:00:00 2001 From: Forrest Date: Sat, 29 Sep 2018 14:24:05 +0800 Subject: [PATCH 15/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e365ece..9e52e15 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ sign = ecc.sign(data, privateKey) // "binargs":"00000" // }] account string // 要执行交易的账户 - desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transaction&result=1&txID=xxx, result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) From 9d1b5f40381c3dd79a821a6d43dd7aa634b8b3d5 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 8 Oct 2018 10:42:28 +0800 Subject: [PATCH 16/54] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e52e15..4958587 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 - from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,可选 + from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,必须 to string // 收款人的EOS账号、EOSForce账号或Ethereum地址,必须 amount number // 转账数量,必须 contract string // 转账的token所属的contract账号名或地址,必须 @@ -161,7 +161,7 @@ sign = ecc.sign(data, privateKey) action string // 支付时,赋值为transfer dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - from string // 付款人的EOS账号或Ethereum地址,可选 + from string // 付款人的EOS账号或Ethereum地址,必须 to string // 收款人的EOS账号或Ethereum地址,必须 amount number // 转账数量,必须 contract string // 转账的token所属的contract账号名或地址 From 6e27d3d2be4f7a6293975605445800387dd9a421 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 8 Oct 2018 10:59:00 +0800 Subject: [PATCH 17/54] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4958587..448696f 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ sign = ecc.sign(data, privateKey) action string // 支付时,赋值为transfer,必须 from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,必须 to string // 收款人的EOS账号、EOSForce账号或Ethereum地址,必须 - amount number // 转账数量,必须 + amount number // 转账数量(带精度,如1.0000 EOS),必须 contract string // 转账的token所属的contract账号名或地址,必须 symbol string // 转账的token名称,必须 precision number // 转账的token的精度,小数点后面的位数,必须 @@ -163,7 +163,7 @@ sign = ecc.sign(data, privateKey) dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 from string // 付款人的EOS账号或Ethereum地址,必须 to string // 收款人的EOS账号或Ethereum地址,必须 - amount number // 转账数量,必须 + amount number // 转账数量(带精度,如1.0000 EOS),必须 contract string // 转账的token所属的contract账号名或地址 symbol string // 转账的token名称,必须 precision number // 转账的token的精度,小数点后面的位数,必须 From 6172b3728e3a713d82ab4c1985a9bc2df5a60bb1 Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 9 Oct 2018 09:44:31 +0800 Subject: [PATCH 18/54] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 448696f..34ef9fd 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、eosforce等) action string // 支付时,赋值为transaction dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 @@ -229,7 +229,7 @@ sign = ecc.sign(data, privateKey) // "action": "transfer", // "binargs":"00000" // }] - account string // 要执行交易的账户 + from string // 要执行交易的账户 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 From f52f3953d1f724f9531983419a5c99696ef1a8e6 Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 9 Oct 2018 15:03:22 +0800 Subject: [PATCH 19/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34ef9fd..c857e33 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ sign = ecc.sign(data, privateKey) "action": "transfer", "binargs":"00000" }] - account string // 要执行交易的账户 + from string // 要执行交易的账户 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如https://abc.com?action=transaction&qrcID=123,可选 From 6823382fad74230d0227f0248bfa2c64dfa4e27c Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 12:10:36 +0800 Subject: [PATCH 20/54] Update README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index c857e33..fa91750 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,13 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 2. 场景2:dapp的移动端拉起钱包APP请求支付授权 3. 场景3:钱包APP内嵌dapp的H5页面,进行支付(暂无) +- 交易体 +1. 场景1:钱包扫描二维码,执行Transaction +2. 场景2:dapp的移动端拉起钱包App,执行Transaction + +- 打开 DApp URL +1. 场景1:dapp的移动端拉起钱包App,打开对应DApp URL + ## 协议内容 ### 1. 钱包APP在系统注册拦截协议 @@ -236,6 +243,23 @@ sign = ecc.sign(data, privateKey) // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transaction&result=1&txID=xxx, result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } +``` +### 5. 打开 DApp URL +#### 场景1:dapp的移动端拉起钱包App,打开对应DApp URL + + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum等) + action string // 支付时,赋值为openUrl + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + dappUrl string // 要跳转的DApp URL链接 +} + ``` ### 错误处理 - code不等于0则请求失败 From 6eb7f6f9e4674cd7cf05998cf5f83801639510a7 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 13:44:00 +0800 Subject: [PATCH 21/54] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fa91750..97a2214 100644 --- a/README.md +++ b/README.md @@ -257,13 +257,15 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接 + dappUrl string // 要跳转的DApp URL链接,可选 } ``` ### 错误处理 - code不等于0则请求失败 +``` // 错误返回 + { code number //错误符,等于0是成功,大于0说明请求失败,dapp返回具体的错误码 error string //返回的提示信息 From ad01fad5243de71c893519323b89f67532f44bcb Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 13:44:38 +0800 Subject: [PATCH 22/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97a2214..8dad07a 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ sign = ecc.sign(data, privateKey) protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 blockchain string // 公链标识(eosio、ethereum等) - action string // 支付时,赋值为openUrl + action string // 跳转时,赋值为openUrl dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 From 3a558003ee4c6ff71757970dd9f6568a847d1be2 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 14:55:14 +0800 Subject: [PATCH 23/54] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8dad07a..e6cbeac 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,9 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接,可选 + dappUrl string // 要跳转的DApp URL链接,可选 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=openUrl,可选 + // 钱包回调时在此URL后加上操作结果(result),如:appABC://abc.com?action=openUrl&result=1, result的值为:0为用户取消, 2为失败;成功不回调; } ``` From 710156a17e538b3fdec1deecd39c67cf4b533818 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 15:24:07 +0800 Subject: [PATCH 24/54] Update README.md --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6cbeac..8faec50 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ sign = ecc.sign(data, privateKey) } ``` -### 错误处理 +### 网络回调接口错误处理 - code不等于0则请求失败 ``` // 错误返回 @@ -273,3 +273,18 @@ sign = ecc.sign(data, privateKey) error string //返回的提示信息 } ``` + +### 麦子钱包DApp跳转错误处理 +- result不等与1 表示取消或失败 +``` +// 错误返回 + +{ + errCode number //错误码 + errorMesssge string //返回的提示信息 +} +// 10000 取消 +// 10001 账户不存在 +// 10002 数据格式异常 +// 10003 其它错误 +``` From 311a0283182b62b628b10dbc8b92a64c63de78ee Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 15:47:30 +0800 Subject: [PATCH 25/54] Update README.md --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 8faec50..8b19619 100644 --- a/README.md +++ b/README.md @@ -278,13 +278,5 @@ sign = ecc.sign(data, privateKey) - result不等与1 表示取消或失败 ``` // 错误返回 - -{ - errCode number //错误码 - errorMesssge string //返回的提示信息 -} -// 10000 取消 -// 10001 账户不存在 -// 10002 数据格式异常 -// 10003 其它错误 +errorMesssge string //返回的提示信息 ``` From 1b5781854a3422d7c093f7c896ae3c75c5e0dda4 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 12 Nov 2018 16:44:46 +0800 Subject: [PATCH 26/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b19619..fb3287c 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接,可选 + dappUrl string // 要跳转的DApp URL链接 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=openUrl,可选 // 钱包回调时在此URL后加上操作结果(result),如:appABC://abc.com?action=openUrl&result=1, result的值为:0为用户取消, 2为失败;成功不回调; } From 044a8d54e4dd410a06a43762703e9ffb2c9824f0 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 26 Nov 2018 16:35:53 +0800 Subject: [PATCH 27/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb3287c..4573f51 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、ethereum、eosfocue、tron等) action string // 跳转时,赋值为openUrl dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 From bf5d0badc7b5dfdcc648bb93b5d1dcd53470a670 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 26 Nov 2018 16:37:09 +0800 Subject: [PATCH 28/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4573f51..4ae2de2 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum、eosfocue、tron等) + blockchain string // 公链标识(eosio、ethereum、eosforce、tron等) action string // 跳转时,赋值为openUrl dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 From 329ea54e266c04a7ea330df149fc5f98abf78252 Mon Sep 17 00:00:00 2001 From: forrest Date: Wed, 28 Nov 2018 12:19:07 +0800 Subject: [PATCH 29/54] =?UTF-8?q?=E6=B3=A2=E5=9C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 141 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 107 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 4ae2de2..6f221f5 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 action string // 赋值为login uuID string // dapp server生成的,用于此次登录验证的唯一标识 loginUrl string // dapp server上用于接受登录验证信息的url - expired number // 二维码过期时间,unix时间戳 + expired number // 二维码过期时间,unix时间戳 loginMemo string // 登录备注信息,钱包用来展示,可选 } ``` @@ -76,7 +76,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) timestamp number // 当前UNIX时间戳 sign string // eos、ethereum签名 uuID string // dapp server生成的,用于此次登录验证的唯一标识 @@ -129,10 +129,10 @@ sign = ecc.sign(data, privateKey) // dapp生成的用于钱包扫描的二维码数据格式 { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet - version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum等) + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、eosforce、ethereum等) dappName string // dapp名字,用于在钱包APP中展示,可选 - dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,必须 to string // 收款人的EOS账号、EOSForce账号或Ethereum地址,必须 @@ -153,6 +153,7 @@ sign = ecc.sign(data, privateKey) - dapp可根据callback中的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或dapp自行搭建节点监控EOS、EOS原力或Ethereum主网,检查代币是否到账 - 对于流行币种如IQ,如果二维码中给出的contract名和官方的合约名不一致,钱包方要提醒用户,做二次确认 - 钱包应该提醒用户注意辨别二维码的来源,避免被钓鱼攻击 +- TRON钱包支付,请查看协议第4部分(交易体)封装 #### 场景2:dapp的移动端拉起钱包App,请求支付授权 @@ -164,10 +165,10 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、ethereum、eosforce等) action string // 支付时,赋值为transfer dappName string // dapp名字,用于在钱包APP中展示,可选 - dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 from string // 付款人的EOS账号或Ethereum地址,必须 to string // 收款人的EOS账号或Ethereum地址,必须 amount number // 转账数量(带精度,如1.0000 EOS),必须 @@ -185,6 +186,7 @@ sign = ecc.sign(data, privateKey) ``` - 钱包组装上述数据,生成一笔EOS或Ethereum的transaction,用户授权此笔转账后,提交转账数据到EOS或Ethereum主网;如果有callback,则回调拉起dapp的应用 - dapp可根据callback里的txID去主网查询此笔交易(不能完全依赖此方式来确认用户的付款);或自行搭建节点监控EOS或Ethereum主网,检查代币是否到账 +- TRON支付,请查看协议第4部分(交易体)封装 ### 4. 交易体 #### 场景1:钱包扫描二维码,执行Transaction @@ -198,51 +200,119 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum等) + blockchain string // 公链标识(eosio、ethereum、eosforce、tron等) action string // 支付时,赋值为transaction dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - actions array // [{ - "code": "eosio.token", - "action": "transfer", - "binargs":"00000" - }] + actions string // JSON 数组,格式:[{"code": "eosio.token","action": "transfer","binargs":"00000"}] from string // 要执行交易的账户 - desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - expired number // 交易过期时间,unix时间戳 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如https://abc.com?action=transaction&qrcID=123,可选 - // 钱包回调时在此URL后加上操作结果(result、txID),如:https://abc.com?action=transaction&qrcID=123&result=1&txID=xxx, - // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) + desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + expired number // 交易过期时间,unix时间戳 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 如https://abc.com?action=transaction&qrcID=123,可选 + // 钱包回调时在此URL后加上操作结果(result、txID), + // 如:https://abc.com?action=transaction&qrcID=123&result=1&txID=xxx, + // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } ``` #### 场景2:dapp的移动端拉起钱包App,执行Transaction -> Ethereum - 参考支付场景,dappData用来存放交易的Data数据。 +> Ethereum(以太坊) + + 参考支付场景,dappData用来存放交易的Data数据。 -> EOS、EOS原力 +> EOS主网、EOS原力 + ``` // 传递给钱包APP的数据包结构 { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce等) + blockchain string // 公链标识(eosio、eosforce) action string // 支付时,赋值为transaction dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - actions array // [{ - // "code": "eosio.token", - // "action": "transfer", - // "binargs":"00000" - // }] - from string // 要执行交易的账户 + actions string // JSON 数组,格式:[{"code": "eosio.token","action": "transfer","binargs":"00000"}] + from string // 要执行交易的账户 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - expired number // 交易过期时间,unix时间戳 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=transfer,可选 - // 钱包回调时在此URL后加上操作结果(result、txID),如:appABC://abc.com?action=transaction&result=1&txID=xxx, result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) + expired number // 交易过期时间,unix时间戳 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 如appABC://abc.com?action=transfer, + // 可选钱包回调时在此URL后加上操作结果(result、txID), + // 如:appABC://abc.com?action=transaction&result=1&txID=xxx, + // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) +} + +``` + +> TRON(波场) + + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(tron) + action string // 调用时,赋值为transaction + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + contract string // JSON 数组,格式参考下面说明; + from string // 要执行交易的账户 + desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + expired number // 交易过期时间,unix时间戳 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 如appABC://abc.com?action=transfer, + // 可选钱包回调时在此URL后加上操作结果(result、txID), + // 如:appABC://abc.com?action=transaction&result=1&txID=xxx, + // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) +} + +// 传递给钱包APP的contract字段说明 + +1. TriggerSmartContract + +{ + "parameter": { + "value": { + "data": "7365870b0000000000000000000000000000000000000000000000000000000000000060", + "owner_address": "414c9727e700492d637aa763d780d82787a48096cb", + "contract_address": "41e19c9914380de8eb9df99b9e6965bd5bf75f2c66", + "call_value": 10000000 + }, + "type_url": "type.googleapis.com/protocol.TriggerSmartContract" + }, + "type": "TriggerSmartContract" } +2. TransferAssetContract +[{ + "parameter": { + "value": { + "amount": 2, + "asset_name": "64696365", + "owner_address": "41fb73f6ebe832359142ca98349deb2d85a464b7b8", + "to_address": "41b621ca08256eb12f6aa3b22d16d520c03c7399dd" + }, + "type_url": "type.googleapis.com/protocol.TransferAssetContract" + }, + "type": "TransferAssetContract" +}] + +3. TransferAssetContract +[{ + "parameter": { + "value": { + "amount": 8, + "owner_address": "41fb73f6ebe832359142ca98349deb2d85a464b7b8", + "to_address": "41b621ca08256eb12f6aa3b22d16d520c03c7399dd" + }, + "type_url": "type.googleapis.com/protocol.TransferContract" + }, + "type": "TransferContract" +}] + +其它... ``` ### 5. 打开 DApp URL #### 场景1:dapp的移动端拉起钱包App,打开对应DApp URL @@ -256,10 +326,13 @@ sign = ecc.sign(data, privateKey) action string // 跳转时,赋值为openUrl dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 dappUrl string // 要跳转的DApp URL链接 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL,如appABC://abc.com?action=openUrl,可选 - // 钱包回调时在此URL后加上操作结果(result),如:appABC://abc.com?action=openUrl&result=1, result的值为:0为用户取消, 2为失败;成功不回调; + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 可选,如appABC://abc.com?action=openUrl, + // 钱包回调时在此URL后加上操作结果(result), + // 如:appABC://abc.com?action=openUrl&result=1, + // result的值为:0为用户取消, 2为失败;成功不回调; } ``` From d0d61e077063d29a43024f9301d153cf491e5f63 Mon Sep 17 00:00:00 2001 From: forrest Date: Wed, 28 Nov 2018 12:20:57 +0800 Subject: [PATCH 30/54] update --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6f221f5..7df7861 100644 --- a/README.md +++ b/README.md @@ -267,11 +267,11 @@ sign = ecc.sign(data, privateKey) // 如:appABC://abc.com?action=transaction&result=1&txID=xxx, // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) } +``` // 传递给钱包APP的contract字段说明 - 1. TriggerSmartContract - +``` { "parameter": { "value": { @@ -284,8 +284,10 @@ sign = ecc.sign(data, privateKey) }, "type": "TriggerSmartContract" } +``` 2. TransferAssetContract +``` [{ "parameter": { "value": { @@ -298,8 +300,10 @@ sign = ecc.sign(data, privateKey) }, "type": "TransferAssetContract" }] +``` -3. TransferAssetContract +3. TransferContract +``` [{ "parameter": { "value": { @@ -311,9 +315,9 @@ sign = ecc.sign(data, privateKey) }, "type": "TransferContract" }] +``` 其它... -``` ### 5. 打开 DApp URL #### 场景1:dapp的移动端拉起钱包App,打开对应DApp URL From 2273647b9b0acfc42df9263473f1f684ae4e17df Mon Sep 17 00:00:00 2001 From: forrest Date: Wed, 28 Nov 2018 12:22:10 +0800 Subject: [PATCH 31/54] update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7df7861..d66f45e 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ sign = ecc.sign(data, privateKey) // 传递给钱包APP的contract字段说明 1. TriggerSmartContract ``` -{ +[{ "parameter": { "value": { "data": "7365870b0000000000000000000000000000000000000000000000000000000000000060", @@ -283,7 +283,7 @@ sign = ecc.sign(data, privateKey) "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" -} +}] ``` 2. TransferAssetContract From 96814b4e6b7a639a9b5d646a8d651fe24be733a6 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 28 Nov 2018 19:36:27 +0800 Subject: [PATCH 32/54] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d66f45e..4020c17 100644 --- a/README.md +++ b/README.md @@ -276,8 +276,8 @@ sign = ecc.sign(data, privateKey) "parameter": { "value": { "data": "7365870b0000000000000000000000000000000000000000000000000000000000000060", - "owner_address": "414c9727e700492d637aa763d780d82787a48096cb", - "contract_address": "41e19c9914380de8eb9df99b9e6965bd5bf75f2c66", + "owner_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2", + "contract_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2", "call_value": 10000000 }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" @@ -292,9 +292,9 @@ sign = ecc.sign(data, privateKey) "parameter": { "value": { "amount": 2, - "asset_name": "64696365", - "owner_address": "41fb73f6ebe832359142ca98349deb2d85a464b7b8", - "to_address": "41b621ca08256eb12f6aa3b22d16d520c03c7399dd" + "asset_name": "WIN", + "owner_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2", + "to_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2" }, "type_url": "type.googleapis.com/protocol.TransferAssetContract" }, @@ -308,8 +308,8 @@ sign = ecc.sign(data, privateKey) "parameter": { "value": { "amount": 8, - "owner_address": "41fb73f6ebe832359142ca98349deb2d85a464b7b8", - "to_address": "41b621ca08256eb12f6aa3b22d16d520c03c7399dd" + "owner_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2", + "to_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, From ba8cd24338a25db56cdc2a34c75cbb9bde679517 Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 4 Dec 2018 13:39:20 +0800 Subject: [PATCH 33/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4020c17..4dbe8a3 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ sign = ecc.sign(data, privateKey) // 如appABC://abc.com?action=transfer, // 可选钱包回调时在此URL后加上操作结果(result、txID), // 如:appABC://abc.com?action=transaction&result=1&txID=xxx, - // result的值为:0为用户取消,1为成功, 2为失败;txID为EOS主网上该笔交易的id(若有) + // result的值为:0为用户取消,1为成功, 2为失败;txID为TRON主网上该笔交易的id(若有) } ``` From 92f92878120c04d3cb132ac311b9d8103db74dd9 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 5 Dec 2018 18:22:46 +0800 Subject: [PATCH 34/54] Update README.md --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4dbe8a3..2cf005e 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ 协议最后更新:2018.09.17 ## 简介 -SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 - +SimpleWallet是一个数字资产钱包和dapp的通用对接协议,支持Ethereum、EOS、EOS Force、TRON。 ## 功能列表 - 登录 @@ -54,7 +53,7 @@ SimpleWallet是一个数字资产钱包和dapp的通用对接协议。 { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum,tron等) dappName string // dapp名字 dappIcon string // dapp图标 action string // 赋值为login @@ -76,7 +75,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum,tron等) timestamp number // 当前UNIX时间戳 sign string // eos、ethereum签名 uuID string // dapp server生成的,用于此次登录验证的唯一标识 @@ -104,7 +103,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum,tron等) dappName string // dapp名字,用于在钱包APP中展示 dappIcon string // dapp图标Url,用于在钱包APP中展示 action string // 赋值为login @@ -130,7 +129,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum等) + blockchain string // 公链标识(eosio、eosforce、ethereum,tron等) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 @@ -165,7 +164,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum、eosforce等) + blockchain string // 公链标识(eosio、ethereum、eosforce,tron等) action string // 支付时,赋值为transfer dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 From a3a97ca61a4f779cfd161333bccf42b463fbd2ea Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 4 Jan 2019 18:58:52 +0800 Subject: [PATCH 35/54] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2cf005e..b7ff03c 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 - from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,必须 + from string // 付款人的EOS账号、EOSForce账号或Ethereum地址,可选 to string // 收款人的EOS账号、EOSForce账号或Ethereum地址,必须 amount number // 转账数量(带精度,如1.0000 EOS),必须 contract string // 转账的token所属的contract账号名或地址,必须 @@ -164,11 +164,11 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum、eosforce,tron等) + blockchain string // 公链标识(eosio、ethereum、eosforce等) action string // 支付时,赋值为transfer dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - from string // 付款人的EOS账号或Ethereum地址,必须 + from string // 付款人的EOS账号或Ethereum地址,可选 to string // 收款人的EOS账号或Ethereum地址,必须 amount number // 转账数量(带精度,如1.0000 EOS),必须 contract string // 转账的token所属的contract账号名或地址 @@ -204,7 +204,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 actions string // JSON 数组,格式:[{"code": "eosio.token","action": "transfer","binargs":"00000"}] - from string // 要执行交易的账户 + from string // 要执行交易的账户,可选 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, @@ -233,7 +233,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 actions string // JSON 数组,格式:[{"code": "eosio.token","action": "transfer","binargs":"00000"}] - from string // 要执行交易的账户 + from string // 要执行交易的账户,可选 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, @@ -257,7 +257,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 contract string // JSON 数组,格式参考下面说明; - from string // 要执行交易的账户 + from string // 要执行交易的账户,可选 desc string // 交易的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 expired number // 交易过期时间,unix时间戳 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, From c5308568c6bf6bf0ef49ca3147a67480ad1b2220 Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 4 Jan 2019 19:00:59 +0800 Subject: [PATCH 36/54] update --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b7ff03c..56ae3b0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 版本:1.0 -协议最后更新:2018.09.17 +协议最后更新:2019.01.04 ## 简介 SimpleWallet是一个数字资产钱包和dapp的通用对接协议,支持Ethereum、EOS、EOS Force、TRON。 @@ -103,7 +103,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum,tron等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) dappName string // dapp名字,用于在钱包APP中展示 dappIcon string // dapp图标Url,用于在钱包APP中展示 action string // 赋值为login @@ -129,7 +129,7 @@ sign = ecc.sign(data, privateKey) { protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、eosforce、ethereum,tron等) + blockchain string // 公链标识(eosio、eosforce、ethereum等) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 action string // 支付时,赋值为transfer,必须 From 7a0911f50916ab3746589c63fc3b25186e05488c Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 8 Jan 2019 11:00:14 +0800 Subject: [PATCH 37/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56ae3b0..450ad9a 100644 --- a/README.md +++ b/README.md @@ -291,7 +291,7 @@ sign = ecc.sign(data, privateKey) "parameter": { "value": { "amount": 2, - "asset_name": "WIN", + "asset_name": "tokenId", // asset_name对应的值为tokenId "owner_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2", "to_address": "TWXNtL6rHGyk2xeVR3QqEN9QGKfgyRTeU2" }, From e9767d847902f2a101f52dbe93526a82eaba47db Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 8 Jan 2019 11:07:37 +0800 Subject: [PATCH 38/54] Update README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 450ad9a..fd5ed40 100644 --- a/README.md +++ b/README.md @@ -330,12 +330,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, - // 可选,如appABC://abc.com?action=openUrl, - // 钱包回调时在此URL后加上操作结果(result), - // 如:appABC://abc.com?action=openUrl&result=1, - // result的值为:0为用户取消, 2为失败;成功不回调; + dappUrl string // 要跳转的DApp URL链接 } ``` From 92deb87a71bfefef0e29122be170b993c3317bb9 Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 8 Jan 2019 11:10:14 +0800 Subject: [PATCH 39/54] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd5ed40..12be888 100644 --- a/README.md +++ b/README.md @@ -330,7 +330,13 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接 + dappUrl string // 要跳转的DApp URL链接 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 可选,如appABC://abc.com?action=openUrl, + // 钱包回调时在此URL后加上操作结果(result), + // 如:appABC://abc.com?action=openUrl&result=0, + // result的值为:0为用户取消, 2为失败;成功不回调; + // 该回调只会在打开URL失败时触发 } ``` From 5903cf24172e97f6665dd57317aed5606f0de892 Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 8 Jan 2019 11:10:44 +0800 Subject: [PATCH 40/54] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12be888..a35430b 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,7 @@ sign = ecc.sign(data, privateKey) // 钱包回调时在此URL后加上操作结果(result), // 如:appABC://abc.com?action=openUrl&result=0, // result的值为:0为用户取消, 2为失败;成功不回调; - // 该回调只会在打开URL失败时触发 + // 该回调只会在打开URL失败或取消时触发 } ``` From 80134ebd3cc88ba30f3ef083eac6ce8b57260d01 Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 25 Jan 2019 18:12:17 +0800 Subject: [PATCH 41/54] Update README.md --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a35430b..d89858e 100644 --- a/README.md +++ b/README.md @@ -314,10 +314,72 @@ sign = ecc.sign(data, privateKey) }, "type": "TransferContract" }] +``` +### 5. 消息签名 +#### 场景1:扫描二维码进行签名 + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum、eosforce、tron等) + action string // 跳转时,赋值为signMessage + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + dappUrl string // 要跳转的DApp URL链接 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 如https://abc.com?action=signMessage,可选 + // 钱包回调时在此URL后加上操作结果(signedMessage), + // 如:https://abc.com?action=signMessage&result=1&signedMessage=xxx, + // result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 +} + +``` +#### 场景2:dapp的移动端拉起钱包进行签名 + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum、eosforce、tron等) + action string // 跳转时,赋值为signMessage + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + message string // 要签名的数据 + isHex bool // 是否是16进制数据 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 可选,如appABC://abc.com?action=signMessage, + // 钱包回调时在此URL后加上操作结果(result), + // 如:appABC://abc.com?action=signMessage&result=1&signedMessage=xxx + //result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 +} + +``` +#### 场景2:扫描二维码进行签名 + ``` +// 传递给钱包APP的数据包结构 +{ + protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet + version string // 协议版本信息,如1.0 + blockchain string // 公链标识(eosio、ethereum、eosforce、tron等) + action string // 跳转时,赋值为openUrl + dappName string // dapp名字,用于在钱包APP中展示,可选 + dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 + desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + dappUrl string // 要跳转的DApp URL链接 + callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, + // 可选,如appABC://abc.com?action=openUrl, + // 钱包回调时在此URL后加上操作结果(result), + // 如:appABC://abc.com?action=openUrl&result=0, + // result的值为:0为用户取消, 2为失败;成功不回调; + // 该回调只会在打开URL失败或取消时触发 +} + ``` -其它... -### 5. 打开 DApp URL +### 6. 打开 DApp URL #### 场景1:dapp的移动端拉起钱包App,打开对应DApp URL ``` From 16b23e45237e28645df325747794b81fa600346d Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 25 Jan 2019 18:13:05 +0800 Subject: [PATCH 42/54] Update README.md --- README.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/README.md b/README.md index d89858e..0d64569 100644 --- a/README.md +++ b/README.md @@ -356,27 +356,6 @@ sign = ecc.sign(data, privateKey) //result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } -``` -#### 场景2:扫描二维码进行签名 - ``` -// 传递给钱包APP的数据包结构 -{ - protocol string // 协议名,钱包用来区分不同协议,本协议为 SimpleWallet - version string // 协议版本信息,如1.0 - blockchain string // 公链标识(eosio、ethereum、eosforce、tron等) - action string // 跳转时,赋值为openUrl - dappName string // dapp名字,用于在钱包APP中展示,可选 - dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 - desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接 - callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, - // 可选,如appABC://abc.com?action=openUrl, - // 钱包回调时在此URL后加上操作结果(result), - // 如:appABC://abc.com?action=openUrl&result=0, - // result的值为:0为用户取消, 2为失败;成功不回调; - // 该回调只会在打开URL失败或取消时触发 -} - ``` ### 6. 打开 DApp URL From bc86769508f07f07596efcb74b01b9cabbef5e97 Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 25 Jan 2019 18:13:31 +0800 Subject: [PATCH 43/54] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d64569..fd6b484 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,8 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - dappUrl string // 要跳转的DApp URL链接 + message string // 要签名的数据 + isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 如https://abc.com?action=signMessage,可选 // 钱包回调时在此URL后加上操作结果(signedMessage), From 352037295a225751e5d8209209d75c5dfa8f0e5d Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 25 Jan 2019 18:42:54 +0800 Subject: [PATCH 44/54] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fd6b484..480dbb3 100644 --- a/README.md +++ b/README.md @@ -327,6 +327,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + from string // 要执行签名的账户 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, @@ -348,6 +349,7 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 + from string // 要执行签名的账户 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, From df310d6b675f11c06791c7af6c5e11ade6b0d14b Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 28 Jan 2019 10:25:23 +0800 Subject: [PATCH 45/54] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 480dbb3..6129a36 100644 --- a/README.md +++ b/README.md @@ -327,17 +327,18 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - from string // 要执行签名的账户 + from string // 要执行签名的账户,可选 + uuID string // dapp生成的,用于dapp签名唯一标识 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 如https://abc.com?action=signMessage,可选 // 钱包回调时在此URL后加上操作结果(signedMessage), - // 如:https://abc.com?action=signMessage&result=1&signedMessage=xxx, + // 如:https://abc.com?action=signMessage&result=1&uuID=xxx&signedMessage=xxx, // result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } + ``` -``` #### 场景2:dapp的移动端拉起钱包进行签名 ``` // 传递给钱包APP的数据包结构 @@ -350,12 +351,13 @@ sign = ecc.sign(data, privateKey) dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 from string // 要执行签名的账户 + uuID string // dapp生成的,用于dapp签名唯一标识 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 可选,如appABC://abc.com?action=signMessage, // 钱包回调时在此URL后加上操作结果(result), - // 如:appABC://abc.com?action=signMessage&result=1&signedMessage=xxx + // 如:appABC://abc.com?action=signMessage&result=1&uuID=xxx&signedMessage=xxx //result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } From 31bb136bfb0d448abed9f6173a760811e4433c01 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 28 Jan 2019 10:41:35 +0800 Subject: [PATCH 46/54] Update README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6129a36..c61a3e8 100644 --- a/README.md +++ b/README.md @@ -328,13 +328,12 @@ sign = ecc.sign(data, privateKey) dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 from string // 要执行签名的账户,可选 - uuID string // dapp生成的,用于dapp签名唯一标识 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 如https://abc.com?action=signMessage,可选 // 钱包回调时在此URL后加上操作结果(signedMessage), - // 如:https://abc.com?action=signMessage&result=1&uuID=xxx&signedMessage=xxx, + // 如:https://abc.com?action=signMessage&result=1&pubKey=xxx&signedMessage=xxx, // result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } ``` @@ -350,14 +349,13 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - from string // 要执行签名的账户 - uuID string // dapp生成的,用于dapp签名唯一标识 + from string // 要执行签名的账户 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 可选,如appABC://abc.com?action=signMessage, // 钱包回调时在此URL后加上操作结果(result), - // 如:appABC://abc.com?action=signMessage&result=1&uuID=xxx&signedMessage=xxx + // 如:appABC://abc.com?action=signMessage&result=1&pubKey=xxx&signedMessage=xxx //result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } From 3d94b1d64ff16cb249e076c4df0e59b160352800 Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 28 Jan 2019 10:48:10 +0800 Subject: [PATCH 47/54] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c61a3e8..fc1319b 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ sign = ecc.sign(data, privateKey) callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 如https://abc.com?action=signMessage,可选 // 钱包回调时在此URL后加上操作结果(signedMessage), - // 如:https://abc.com?action=signMessage&result=1&pubKey=xxx&signedMessage=xxx, + // 如:https://abc.com?action=signMessage&result=1&account=xxx&pubKey=xxx&signedMessage=xxx, // result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } ``` @@ -355,7 +355,7 @@ sign = ecc.sign(data, privateKey) callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, // 可选,如appABC://abc.com?action=signMessage, // 钱包回调时在此URL后加上操作结果(result), - // 如:appABC://abc.com?action=signMessage&result=1&pubKey=xxx&signedMessage=xxx + // 如:appABC://abc.com?action=signMessage&result=1&account=xxx&pubKey=xxx&signedMessage=xxx //result的值为:0为用户取消,1为成功, 2为失败;signedMessage被签名后的数据 } From 4eaec3c65dd5a21c87f636734eb019e17ca8363b Mon Sep 17 00:00:00 2001 From: Forrest Date: Mon, 28 Jan 2019 10:59:53 +0800 Subject: [PATCH 48/54] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index fc1319b..cff6267 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,6 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - from string // 要执行签名的账户,可选 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, @@ -349,7 +348,6 @@ sign = ecc.sign(data, privateKey) dappName string // dapp名字,用于在钱包APP中展示,可选 dappIcon string // dapp图标Url,用于在钱包APP中展示,可选 desc string // 跳转的说明信息,钱包在付款UI展示给用户,最长不要超过128个字节,可选 - from string // 要执行签名的账户 message string // 要签名的数据 isHex bool // 是否是16进制数据 callback string // 用户完成操作后,钱包回调拉起dapp移动端的回调URL, From df7040f3bc81e0e7eca01d9207f737f8f3b00ee0 Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 1 Mar 2019 15:50:33 +0800 Subject: [PATCH 49/54] init --- math_qrcode_document.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 math_qrcode_document.md diff --git a/math_qrcode_document.md b/math_qrcode_document.md new file mode 100644 index 0000000..9fe3ed4 --- /dev/null +++ b/math_qrcode_document.md @@ -0,0 +1,35 @@ +## 概述 +本文档是对 Math Wallet 常用二维码格式说明 + +二维码格式: + +转账 +~~~ +{ + "client": "MathWallet", + "type": "EOS", + "action": "transfer", + "data": { + "to": "bigbigbigbig", + "amount": "1.0000 EOS", + "precision": 4, + "contract": "eosio.token" + } +} +~~~ +购买内存 +~~~ +{ + "client": "MathWallet", + "type": "EOS", + "action": "createAccount", + "data": { + "account_name": "bigbigbigbig", + "owner": "EOS7n5Aufs8wzsDaNpgez4HUz9W4VU45sQMKm8tAYRrshy1q3twPD", + "active": "EOS7n5Aufs8wzsDaNpgez4HUz9W4VU45sQMKm8tAYRrshy1q3twPD", + "ram": 1024, + "net": "0.3000 EOS", + "cpu": "0.3000 EOS" + } +} +~~~ From 058a7943a56c65d3f143d755d51745fddfeb052b Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 1 Mar 2019 15:51:27 +0800 Subject: [PATCH 50/54] Update math_qrcode_document.md --- math_qrcode_document.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math_qrcode_document.md b/math_qrcode_document.md index 9fe3ed4..fdcdeef 100644 --- a/math_qrcode_document.md +++ b/math_qrcode_document.md @@ -1,7 +1,7 @@ ## 概述 本文档是对 Math Wallet 常用二维码格式说明 -二维码格式: +## 二维码格式: 转账 ~~~ From 0b6da2cfcbe1a6adbb9fdb8444d20db6c8ca35fd Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 1 Mar 2019 15:52:46 +0800 Subject: [PATCH 51/54] Update math_qrcode_document.md --- math_qrcode_document.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/math_qrcode_document.md b/math_qrcode_document.md index fdcdeef..91f2148 100644 --- a/math_qrcode_document.md +++ b/math_qrcode_document.md @@ -1,7 +1,4 @@ -## 概述 -本文档是对 Math Wallet 常用二维码格式说明 - -## 二维码格式: +## Math Wallet QRCode 文档 转账 ~~~ From 3e162b596ec7a6223ed09c45b2b0a6cb3b519076 Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 1 Mar 2019 15:54:57 +0800 Subject: [PATCH 52/54] Update math_qrcode_document.md --- math_qrcode_document.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/math_qrcode_document.md b/math_qrcode_document.md index 91f2148..07de9a7 100644 --- a/math_qrcode_document.md +++ b/math_qrcode_document.md @@ -14,19 +14,5 @@ } } ~~~ -购买内存 -~~~ -{ - "client": "MathWallet", - "type": "EOS", - "action": "createAccount", - "data": { - "account_name": "bigbigbigbig", - "owner": "EOS7n5Aufs8wzsDaNpgez4HUz9W4VU45sQMKm8tAYRrshy1q3twPD", - "active": "EOS7n5Aufs8wzsDaNpgez4HUz9W4VU45sQMKm8tAYRrshy1q3twPD", - "ram": 1024, - "net": "0.3000 EOS", - "cpu": "0.3000 EOS" - } -} -~~~ + +* 使用 SimpleWallet 协议,可参考 https://github.com/MediShares/SimpleWallet/blob/master/README.md From 9c4b2723896218ddff21a7ebdfa0f933851b0166 Mon Sep 17 00:00:00 2001 From: Forrest Date: Fri, 1 Mar 2019 15:56:40 +0800 Subject: [PATCH 53/54] Update math_qrcode_document.md --- math_qrcode_document.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/math_qrcode_document.md b/math_qrcode_document.md index 07de9a7..811db0d 100644 --- a/math_qrcode_document.md +++ b/math_qrcode_document.md @@ -10,7 +10,8 @@ "to": "bigbigbigbig", "amount": "1.0000 EOS", "precision": 4, - "contract": "eosio.token" + "contract": "eosio.token", + "memo":"memo" } } ~~~ From 365732dbbe122fe4da839c98e74d441270ecdf14 Mon Sep 17 00:00:00 2001 From: Jesse Mckane Gonzales <71523492+ightevenmckane1@users.noreply.github.com> Date: Fri, 16 Jun 2023 21:24:26 -0500 Subject: [PATCH 54/54] Create dependabot.yml --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4eeafeb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily"