【问题标题】:Ripple Transaction from one local wallet to exchange wallet(example : crex24) gives error code tecDST_TAG_NEEDED using java从一个本地钱包到交换钱包的波纹交易(例如:crex24)使用 java 给出错误代码 tecDST_TAG_NEEDED
【发布时间】:2019-08-06 03:16:51
【问题描述】:

我在本地服务器上安装了波纹钱包。我创建了一个钱包并用 20 XRP 激活它。

现在,当我从我的活动帐户向帐户(crex24.com)发送硬币时,它会给出 tecDST_TAG_NEEDED 错误代码

涟漪:http://127.0.0.1:5005

代码(使用提交方法):

RestTemplate template = new RestTemplate();
Map<String,Object> mainMap = new HashMap<>();
mainMap.put("secret", "sxxxxxxxxxxx");
mainMap.put("Fee", "1000"); // in drops

Map<String,String> subMap = new HashMap<>();
subMap.put("Account", "raxxxxxxxxx"); // amount will be deducted from this account
subMap.put("Amount", "1000000"); // in drops
subMap.put("Destination", "rdxxxxxxxxx"); // receiver address
subMap.put("TransactionType", "Payment"); // since we are making a  payment request

mainMap.put("tx_json", subMap);

JSONObject json = new JSONObject();
json.put("method", "submit");
json.put("params", new JSONArray(mainMap)); 
String requestData = json.toString();
System.out.println(requestData);
String response = template.postForObject("http://127.0.0.1:5005", requestData,String.class);
System.out.println(response);

错误

{
  "status": 200,
  "message": "Transaction achieved successfully.",
  "data": {
    "result": {
      "deprecated": "Signing support in the 'submit' command has been deprecated and will be removed in a future version of the server. Please migrate to a standalone signing tool.",
      "engine_result": "tecDST_TAG_NEEDED",
      "engine_result_code": 143,
      "engine_result_message": "A destination tag is required.",
      "status": "success",
      "tx_blob": "120000228000000024000000096140000000000F424068400000000000000A7321036CB83FF75DAxxxxxxxxxxxxxxxxxx",
      "tx_json": {
        "Account": "raxxxxxxxxx",
        "Amount": "1000000",
        "Destination": "rdxxxxxxxxx",
        "Fee": "10",
        "Flags": 214482148,
        "Sequence": 9,
        "SigningPubKey": "036Cxxxxxxxxxxxxxxx6",
        "TransactionType": "Payment",
        "TxnSignature": "txxxxxxxxx",
        "hash": "hxxxxxxxxxx"
      }
    }
  },
  "path": "/api/ripple_wallet/makeTransaction"
}

【问题讨论】:

    标签: java ripple rippled


    【解决方案1】:

    您在crex24.com 上的帐户需要destination tagXRPL 使用 account model 类似于 ETH。与使用 UTXO modelBTC 不同。

    某些交易所需要destination tag 的原因是您可能与交易所中的其他人共享该地址。例如:

    • Person1的存款地址是:Addr1
    • Person2的存款地址也是Addr1
    • 有人将100XRP 存入Addr1

    在上述情况下,交易所无法区分是Person1 还是Person2
    所以XRPL 引入了destination tag,看起来类似于:

    • Exchange 使用accountSet 事务将Addr1tfRequireDestTag 标志设置为true
    • Person1的存款地址是:Addr1:1234
    • Person2的存款地址也是Addr1:1235
    • 有人将100XRP 存入Addr1XRPL 拒绝,因为 tfRequireDestTag 被设置为 true /这是你的情况/
    • 有人将50XRP 发送到Addr1:1234&lt;-- this one succeeds!

    【讨论】:

    • 谢谢,明白了,也实现了。但我可以使用涟漪的“account_info”方法获得我的帐户余额。 "account_info" 方法返回整个账户的总余额。但是,如果我的帐户有多个目标标签,我如何获得目标标签明智的余额?你有什么想法
    • 哦,余额是帐户本身的。 destTag 实际上只是tx 的可选数据。您必须实施一种机制来跟踪每个destTag 的余额。如何跟踪完全取决于您。要记住的重要一点是destTag 的所有余额之和必须等于帐户的余额。
    猜你喜欢
    • 2022-11-05
    • 2016-02-12
    • 2012-05-31
    • 2020-12-15
    • 1970-01-01
    • 2021-10-07
    • 1970-01-01
    • 2022-01-05
    • 2021-12-19
    相关资源
    最近更新 更多