建议和反馈

请填写你的反馈内容

问答 > 公有链 > 问答详情
求助中

请问一下,eos获取交易签名需要用的钱包,怎么获取呢?10LK

  PackedTransaction packedTransaction2 = rpcProvider.signTransaction(signTransactionRequest);


这两天刚接触EOS,这段代码一直调试不通过,请问是否需要钱包功能呢?


     String exPiration = dateFormat.format(date);


        PackedTransaction packedTransaction = new PackedTransaction();

        packedTransaction.setRef_block_prefix(getBlockResponse.getRefBlockPrefix().longValue());

        packedTransaction.setRef_block_num(getBlockResponse.getBlockNum().longValue());

        packedTransaction.setExpiration(exPiration);

       // packedTransaction.setRegion("0");

         packedTransaction.setNet_usage_words(0l);

        packedTransaction.setActions(Collections.singletonList(transactionAction));


        //打开钱包

      //  rpcProvider.openWallet(walletName);

        //解锁钱包

       // eosApiRestClient.unlockWallet(walletName, walletPassword);

        

    List<String> publicKeys = new ArrayList<String>();

    publicKeys.add("EOS7Vs9SJYj5UU5bHCBzBpgY4cAeTAYYecvU1a9XETfsx2ddMKmx1");

    // publicKeys.add("EOS8HDo77AYyJaAVS9kioDGmoYCibKqQxn2jjFdj5hKBWHGoVnWRL");


    SignTransactionRequest signTransactionRequest = new SignTransactionRequest(packedTransaction, publicKeys, CHAINID);

    PackedTransaction packedTransaction2 = rpcProvider.signTransaction(signTransactionRequest);

System.out.println(packedTransaction2.getExpiration());


2019-10-11
0
请先登陆或注册

暂无回答!

求助中

解决了这个问题,预计可以帮助到

  • 0
  • 2
  • 4
  • 6
  • 4
邀请

感谢您的善举,每一次解答会成为新人的灯塔,回答被采纳后获得20算力和相应的LK币奖励