@Test public void getToAddress() throws Exception { ECKey toKey = new ECKey(); Address toAddress = toKey.toAddress(PARAMS); assertEquals(toAddress, ScriptBuilder.createOutputScript(toKey).getToAddress(PARAMS, true)); assertEquals(toAddress, ScriptBuilder.createOutputScript(toAddress).getToAddress(PARAMS, true)); Script p2shScript = ScriptBuilder.createP2SHOutputScript(new byte[20]); Address scriptAddress = Address.fromP2SHScript(PARAMS, p2shScript); assertEquals(scriptAddress, p2shScript.getToAddress(PARAMS, true)); }
public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); }
Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } }
Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private  Script();   Script(List<ScriptChunk> chunks);  Script(byte[] programBytes);  Script(byte[] programBytes, long creationTimeSeconds); }
Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private  Script();   Script(List<ScriptChunk> chunks);  Script(byte[] programBytes);  Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSeconds(long creationTimeSeconds); @Override String toString(); byte[] getProgram(); List<ScriptChunk> getChunks(); boolean isSentToRawPubKey(); boolean isSentToAddress(); @Deprecated boolean isSentToP2SH(); boolean isSentToP2WPKH(); boolean isSentToP2WPKHP2SH(ECKey pubKey); boolean isSentToP2WSH(); boolean isSentToP2WSHP2SH(Script script); byte[] getPubKeyHash(); byte[] getPubKey(); byte[] getCLTVPaymentChannelSenderPubKey(); byte[] getCLTVPaymentChannelRecipientPubKey(); BigInteger getCLTVPaymentChannelExpiry(); @Deprecated Address getFromAddress(NetworkParameters params); Address getToAddress(NetworkParameters params); Address getToAddress(NetworkParameters params, boolean forcePayToPubKey); static void writeBytes(OutputStream os, byte[] buf); static byte[] createMultiSigOutputScript(int threshold, List<ECKey> pubkeys); static byte[] createInputScript(byte[] signature, byte[] pubkey); static byte[] createInputScript(byte[] signature); Script createEmptyInputScript(@Nullable ECKey key, @Nullable Script redeemScript); Script getScriptSigWithSignature(Script scriptSig, byte[] sigBytes, int index); int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey); List<ECKey> getPubKeys(); static int getSigOpCount(byte[] program); static long getP2SHSigOpCount(byte[] scriptSig); int getNumberOfSignaturesRequiredToSpend(); int getNumberOfBytesRequiredToSpend(@Nullable ECKey pubKey, @Nullable Script redeemScript); boolean isPayToScriptHash(); boolean isSentToMultiSig(); boolean isSentToCLTVPaymentChannel(); static byte[] removeAllInstancesOf(byte[] inputScript, byte[] chunkToRemove); static byte[] removeAllInstancesOfOp(byte[] inputScript, int opCode); boolean isOpReturn(); @Deprecated static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, boolean enforceNullDummy); @Deprecated static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, Set<VerifyFlag> verifyFlags); static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, Coin value, boolean segwit,
                                     Set<VerifyFlag> verifyFlags); @Deprecated void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey); @Deprecated void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey,
                                Set<VerifyFlag> verifyFlags); void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey, Coin value,
                                Set<VerifyFlag> verifyFlags); ScriptType getScriptType(); @Override boolean equals(Object o); @Override int hashCode(); boolean isWitnessProgram(); Script scriptCode(TransactionWitness witness); Script scriptCode(); LinkedList<byte[]> witnessStack(TransactionWitness witness); }
Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private  Script();   Script(List<ScriptChunk> chunks);  Script(byte[] programBytes);  Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSeconds(long creationTimeSeconds); @Override String toString(); byte[] getProgram(); List<ScriptChunk> getChunks(); boolean isSentToRawPubKey(); boolean isSentToAddress(); @Deprecated boolean isSentToP2SH(); boolean isSentToP2WPKH(); boolean isSentToP2WPKHP2SH(ECKey pubKey); boolean isSentToP2WSH(); boolean isSentToP2WSHP2SH(Script script); byte[] getPubKeyHash(); byte[] getPubKey(); byte[] getCLTVPaymentChannelSenderPubKey(); byte[] getCLTVPaymentChannelRecipientPubKey(); BigInteger getCLTVPaymentChannelExpiry(); @Deprecated Address getFromAddress(NetworkParameters params); Address getToAddress(NetworkParameters params); Address getToAddress(NetworkParameters params, boolean forcePayToPubKey); static void writeBytes(OutputStream os, byte[] buf); static byte[] createMultiSigOutputScript(int threshold, List<ECKey> pubkeys); static byte[] createInputScript(byte[] signature, byte[] pubkey); static byte[] createInputScript(byte[] signature); Script createEmptyInputScript(@Nullable ECKey key, @Nullable Script redeemScript); Script getScriptSigWithSignature(Script scriptSig, byte[] sigBytes, int index); int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey); List<ECKey> getPubKeys(); static int getSigOpCount(byte[] program); static long getP2SHSigOpCount(byte[] scriptSig); int getNumberOfSignaturesRequiredToSpend(); int getNumberOfBytesRequiredToSpend(@Nullable ECKey pubKey, @Nullable Script redeemScript); boolean isPayToScriptHash(); boolean isSentToMultiSig(); boolean isSentToCLTVPaymentChannel(); static byte[] removeAllInstancesOf(byte[] inputScript, byte[] chunkToRemove); static byte[] removeAllInstancesOfOp(byte[] inputScript, int opCode); boolean isOpReturn(); @Deprecated static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, boolean enforceNullDummy); @Deprecated static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, Set<VerifyFlag> verifyFlags); static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, Coin value, boolean segwit,
                                     Set<VerifyFlag> verifyFlags); @Deprecated void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey); @Deprecated void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey,
                                Set<VerifyFlag> verifyFlags); void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey, Coin value,
                                Set<VerifyFlag> verifyFlags); ScriptType getScriptType(); @Override boolean equals(Object o); @Override int hashCode(); boolean isWitnessProgram(); Script scriptCode(TransactionWitness witness); Script scriptCode(); LinkedList<byte[]> witnessStack(TransactionWitness witness); static final EnumSet<VerifyFlag> ALL_VERIFY_FLAGS; static final long MAX_SCRIPT_ELEMENT_SIZE; static final int SIG_SIZE; static final int MAX_P2SH_SIGOPS; }