public Transaction send(String destinationAddress, long amountSatoshis)
     throws InsufficientMoneyException {
   Address addressj;
   try {
     addressj = new Address(params, destinationAddress);
   } catch (AddressFormatException e) {
     e.printStackTrace();
     throw new RuntimeException(e);
   }
   Coin amount = Coin.valueOf(amountSatoshis);
   // create a tx to destinationAddress of amount and broadcast by wallets peergroup
   Wallet.SendResult sendResult = getKit().wallet().sendCoins(kit.peerGroup(), addressj, amount);
   try {
     return sendResult.broadcastComplete.get();
   } catch (InterruptedException | ExecutionException e) {
     e.printStackTrace();
     throw new RuntimeException(e);
   }
 }
 private WalletAppKit initKit(@Nullable DeterministicSeed seed) {
   // initialize files and stuff here, add our address to the watched ones
   WalletAppKit kit = new WalletAppKit(params, new File("./spv"), fileprefix);
   kit.setAutoSave(true);
   kit.useTor();
   kit.setDiscovery(new DnsDiscovery(params));
   // fresh restore if seed provided
   if (seed != null) {
     kit.restoreWalletFromSeed(seed);
   }
   // startUp WalletAppKit
   kit.startAndWait();
   return kit;
 }
 public String sendOffline(String destinationAddress, long amountSatoshis)
     throws InsufficientMoneyException {
   Address addressj;
   try {
     addressj = new Address(params, destinationAddress);
   } catch (AddressFormatException e) {
     e.printStackTrace();
     throw new RuntimeException(e);
   }
   Coin amount = Coin.valueOf(amountSatoshis);
   // create a SendRequest of amount to destinationAddress
   Wallet.SendRequest sendRequest = Wallet.SendRequest.to(addressj, amount);
   // set dynamic fee
   sendRequest.feePerKb = getRecommendedFee();
   // complete & sign tx
   kit.wallet().completeTx(sendRequest);
   kit.wallet().signTransaction(sendRequest);
   // return tx bytes as hex encoded String
   return Hex.encodeHexString(sendRequest.tx.bitcoinSerialize());
 }