Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ddnlink/ddn-dapp
DDN Dapp
https://github.com/ddnlink/ddn-dapp
Last synced: about 1 month ago
JSON representation
DDN Dapp
- Host: GitHub
- URL: https://github.com/ddnlink/ddn-dapp
- Owner: ddnlink
- Created: 2019-08-19T03:31:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T23:12:18.000Z (about 2 years ago)
- Last Synced: 2023-03-10T05:16:43.137Z (almost 2 years ago)
- Language: JavaScript
- Size: 96.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
DDN Dapp
===交易体创建方法:
ddnJS.assetPlugin.createPluginAsset(trsType, assetInfo, secret, secondSecret)
参数:
trsType: 创建交易的类型
assetInfo: 创建交易的具体内容
secret: 账号的密码
secondSecret: 二级密码;(可不传)
返回:
创建成功的交易体对象##一:Dapp
注册Dapp
```
trsType: 11
assetInfo: {
name: DappName, //Dapp名称
type: node.DappType.DAPP, //Dapp类型
category: node.randomProperty(node.DappCategory), //Dapp分类
link: node.guestbookDapp.link, //Dapp程序包链接
description: "A dapp added via API autotest", //描述
tags: "handy dizzy pear airplane alike wonder nifty curve young probable tart concentrate", //标签,空格分隔
icon: node.guestbookDapp.icon, //Dapp Logo链接
delegates: delegates.join(","), //Dapp 受托人公钥串,多个用逗号分隔
unlock_delegates: 3 //转出操作需要的最小受托人确认数
}
```##二:inTransfer
向Dapp内转账
```
trsType: 12
assetInfo: {
dapp_id: "f90e1f741168106f3bbd76e5eea6aa47d725d1e9b78e2ad6f043d0719881ba22", //Dapp Id
currency: "DDN", //要转入的币种
amount: "100000000" //要转入的金额
}
```##三:outTransfer
从Dapp向外转账
```
trsType: 13
assetInfo: {
recipient_id: , //转账接收账户地址
dapp_id: "f90e1f741168106f3bbd76e5eea6aa47d725d1e9b78e2ad6f043d0719881ba22", //Dapp Id
currency: "DDN", //要转出的币种
aobAmount: "10000000" //要转出的金额,
signatures: [ //受托人签名数组,通过方法await node.ddn.transfer.signOutTransfer(trs, delegatePassword)获得
"xxxxxxxxxxxxxxxxxxxxxxx",
"yyyyyyyyyyyyyyyyyyyyyyy",
"zzzzzzzzzzzzzzzzzzzzzzz"
]
}
```有关Dapp相关信息请查看ddn-docs项目的Dapp部分