@Test public void testTransferTransaction(){ ECKey sourcePrivateKey = new BrainKey(BILTHON_7_BRAIN_KEY, 0).getPrivateKey(); PublicKey to1 = new PublicKey(ECKey.fromPublicOnly(new BrainKey(BILTHON_5_BRAIN_KEY, 0).getPublicKey())); PublicKey to2 = new PublicKey(ECKey.fromPublicOnly(new BrainKey(BILTHON_16_BRAIN_KEY, 0).getPublicKey())); BigInteger nonce = BigInteger.ONE; byte[] encryptedMessage = Memo.encryptMessage(sourcePrivateKey, to1, nonce, "another message"); Memo memo = new Memo(new Address(ECKey.fromPublicOnly(sourcePrivateKey.getPubKey())), new Address(to1.getKey()), nonce, encryptedMessage); TransferOperation transferOperation1 = new TransferOperationBuilder() .setTransferAmount(new AssetAmount(UnsignedLong.valueOf(1), CORE_ASSET)) .setSource(bilthon_7) .setDestination(bilthon_5) .setFee(new AssetAmount(UnsignedLong.valueOf(FEE_AMOUNT), CORE_ASSET)) .setMemo(memo) .build(); TransferOperation transferOperation2 = new TransferOperationBuilder() .setTransferAmount(new AssetAmount(UnsignedLong.valueOf(1), CORE_ASSET)) .setSource(bilthon_7) .setDestination(bilthon_16) .setFee(new AssetAmount(UnsignedLong.valueOf(FEE_AMOUNT), CORE_ASSET)) .setMemo(memo) .build(); ArrayList<BaseOperation> operationList = new ArrayList<>(); operationList.add(transferOperation1); operationList.add(transferOperation2); broadcastTransaction(sourcePrivateKey, operationList, listener, null); }
public ECKey getPrivateKey(){ return this.privateKey; }
Transaction implements ByteSerializable, JsonSerializable { public ECKey getPrivateKey(){ return this.privateKey; } }
Transaction implements ByteSerializable, JsonSerializable { public ECKey getPrivateKey(){ return this.privateKey; } Transaction(byte[] chainId, ECKey privateKey, BlockData blockData, List<BaseOperation> operations);  Transaction(ECKey privateKey, BlockData blockData, List<BaseOperation> operationList);  Transaction(String wif, BlockData block_data, List<BaseOperation> operation_list);  Transaction(BlockData blockData, List<BaseOperation> operationList); }
Transaction implements ByteSerializable, JsonSerializable { public ECKey getPrivateKey(){ return this.privateKey; } Transaction(byte[] chainId, ECKey privateKey, BlockData blockData, List<BaseOperation> operations);  Transaction(ECKey privateKey, BlockData blockData, List<BaseOperation> operationList);  Transaction(String wif, BlockData block_data, List<BaseOperation> operation_list);  Transaction(BlockData blockData, List<BaseOperation> operationList); void setBlockData(BlockData blockData); BlockData getBlockData(); void setFees(List<AssetAmount> fees); ECKey getPrivateKey(); List<BaseOperation> getOperations(); boolean hasPrivateKey(); byte[] getGrapheneSignature(); void setChainId(String chainId); void setChainId(byte[] chainId); byte[] getChainId(); byte[] toBytes(); @Override String toJsonString(); @Override JsonObject toJsonObject(); }
Transaction implements ByteSerializable, JsonSerializable { public ECKey getPrivateKey(){ return this.privateKey; } Transaction(byte[] chainId, ECKey privateKey, BlockData blockData, List<BaseOperation> operations);  Transaction(ECKey privateKey, BlockData blockData, List<BaseOperation> operationList);  Transaction(String wif, BlockData block_data, List<BaseOperation> operation_list);  Transaction(BlockData blockData, List<BaseOperation> operationList); void setBlockData(BlockData blockData); BlockData getBlockData(); void setFees(List<AssetAmount> fees); ECKey getPrivateKey(); List<BaseOperation> getOperations(); boolean hasPrivateKey(); byte[] getGrapheneSignature(); void setChainId(String chainId); void setChainId(byte[] chainId); byte[] getChainId(); byte[] toBytes(); @Override String toJsonString(); @Override JsonObject toJsonObject(); static final int DEFAULT_EXPIRATION_TIME; static final String KEY_EXPIRATION; static final String KEY_SIGNATURES; static final String KEY_OPERATIONS; static final String KEY_EXTENSIONS; static final String KEY_REF_BLOCK_NUM; static final String KEY_REF_BLOCK_PREFIX; }