遵义链
  1. DDC-1155
遵义链
  • 遵义链
    • JAVA-SDK
      • BSN-遵义链
        • 快速入门
          • 概述
          • DDC合约协议标准
          • 开发准备
        • 常见问题
          • Failed to initialize a channel
          • PKIX path building failed
          • Invalid keystore format
          • to account is not a standard address format
          • the ddc account does not exist
          • Amount is less than 0, Please recharge.
          • 接口合约地址只能传参可以自己读配置文件吗
          • 刚铸造的 然后去查询就提示不存在
          • net.corda.core.internal.TransactionDeserialisationException
          • 转增这个返回值怎么理解
          • 铸造交易HASH获取
        • DDC-权限管理
          • 添加账户
          • 查询账户
          • 更新账户状态
        • DDC-721
          • 铸造
          • 转移
          • 销毁
          • 授权
          • 账户授权
          • 查询数量
          • 查询拥有者
          • 获取名称
          • 获取符号
          • 获取DDCURI
          • 交易记录
          • ddc列表
          • ddc查询
        • DDC-1155
          • 铸造
          • 批量铸造
          • 转移
          • 批量转移
          • 销毁
          • 批量销毁
          • 账户授权
          • 查询数量
          • 批量查询数量
          • 交易记录
          • ddc列表
          • ddc查询
        • DDC-交易查询
          • 交易事件
        • DDC-4907
          • 设置用户
          • 查询用户
          • 用户过期时间查询
        • DDC-Soulbound Token
          • 铸造
          • 销毁
          • 设置属性
          • 查询数量
          • 查询拥有者
          • 获取名称
          • 获取符号
          • 获取DDCURI
          • 获取属性
  1. DDC-1155

转移

功能介绍#

DDC拥有者或授权者可以通过调用该方法进行DDC的转移。

方法定义:#

String safeTransferFrom(String from,String to,String indexId,BigInteger amount,byte[] data);

调用者:#

DDC拥有者、DDC授权者;

核心逻辑:#

1.
检查sender为标准address格式;
2.
检查拥有者账户地址信息是否为空;
3.
检查拥有者账户地址格式是否正确;
4.
检查接收者账户地址信息是否为空;
5.
检查接收者账户地址格式是否正确;
6.
检查INDEXID数值是否为空;
7.
检查DDC转移所对应的数量是否大于0;

输入参数:#

字段名字段类型必传备注
拥有者账户fromString是
接收者账户toString是
DDC唯一标识indexIdString是
数量amountBigInteger是DDCID所对应的数量
附加数据databyte[]否冗余字段

输出参数:#

字段名字段类型必传备注
String是交易哈希

测试用例:#

/**
转移
*/
@Test
public void safeTransferFrom1155() throws Exception {
String from = "Slabs:b6a14fcb043fbb457efdd196d71fcd6eb008ffc8_O=Slabs,L=Beijing,C=CN";
String to = "UUU2-ZEKE_O=Slabs,L=Beijing,C=CN";
String ddcId = "4085816735464751104";
BigInteger amount = BigInteger.ONE;
String stx = ddc1155Service.safeTransferFrom(from, to, ddcId, amount, null);
System.out.println("转移:" + stx);
System.out.println("转移:" + ddc1155Service.getTxHashByToString(stx));
}
修改于 2022-09-26 08:49:36
上一页
批量铸造
下一页
批量转移
Built with