public class ScriptBuilder extends Object
Tools for the construction of commonly used script types. You don't normally need this as it's hidden behind
convenience methods on Transaction
, but they are useful when working with the
protocol at a lower level.
Constructor and Description |
---|
ScriptBuilder() |
Modifier and Type | Method and Description |
---|---|
Script |
build() |
static Script |
createInputScript(TransactionSignature signature)
Creates a scriptSig that can redeem a pay-to-pubkey output.
|
static Script |
createInputScript(TransactionSignature signature,
ECKey pubKey)
Creates a scriptSig that can redeem a pay-to-address output.
|
static Script |
createMultiSigInputScript(List<TransactionSignature> signatures)
Create a program that satisfies an OP_CHECKMULTISIG program.
|
static Script |
createMultiSigInputScript(TransactionSignature... signatures)
Create a program that satisfies an OP_CHECKMULTISIG program.
|
static Script |
createMultiSigInputScriptBytes(List<byte[]> signatures)
Create a program that satisfies an OP_CHECKMULTISIG program, using pre-encoded signatures.
|
static Script |
createMultiSigOutputScript(int threshold,
List<ECKey> pubkeys)
Creates a program that requires at least N of the given keys to sign, using OP_CHECKMULTISIG.
|
static Script |
createOutputScript(Address to)
Creates a scriptPubKey that encodes payment to the given address.
|
static Script |
createOutputScript(ECKey key)
Creates a scriptPubKey that encodes payment to the given raw public key.
|
static Script |
createP2SHOutputScript(byte[] hash)
Creates a scriptPubKey that sends to the given script hash.
|
ScriptBuilder |
data(byte[] data) |
ScriptBuilder |
op(int opcode) |
ScriptBuilder |
smallNum(int num) |
public ScriptBuilder op(int opcode)
public ScriptBuilder data(byte[] data)
public ScriptBuilder smallNum(int num)
public Script build()
public static Script createOutputScript(Address to)
public static Script createOutputScript(ECKey key)
public static Script createInputScript(TransactionSignature signature, ECKey pubKey)
public static Script createInputScript(TransactionSignature signature)
public static Script createMultiSigOutputScript(int threshold, List<ECKey> pubkeys)
public static Script createMultiSigInputScript(List<TransactionSignature> signatures)
public static Script createMultiSigInputScript(TransactionSignature... signatures)
public static Script createMultiSigInputScriptBytes(List<byte[]> signatures)
Copyright © 2014. All rights reserved.