Builder

class Builder
Input data necessary to create a signed transaction.
Protobuf type TW.Bitcoin.Proto.SigningInput

Functions

Link copied to clipboard
open fun addAllPrivateKey(values: Iterable<out ByteString>): Bitcoin.SigningInput.Builder
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
open fun addAllUtxo(values: Iterable<out UnspentTransaction>): Bitcoin.SigningInput.Builder
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
open fun addPrivateKey(value: ByteString): Bitcoin.SigningInput.Builder
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
open fun addUtxo(builderForValue: Builder): Bitcoin.SigningInput.Builder
open fun addUtxo(value: UnspentTransaction): Bitcoin.SigningInput.Builder
open fun addUtxo(index: Int, builderForValue: Builder): Bitcoin.SigningInput.Builder
open fun addUtxo(index: Int, value: UnspentTransaction): Bitcoin.SigningInput.Builder
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
Amount to send.  Transaction created will have this amount in its output, 
except when use_max_amount is set, in that case this amount is not relevant, maximum possible amount will be used (max avail less fee).
If amount is equal or more than the available amount, also max amount will be used.
int64 amount = 2;
Link copied to clipboard
Transaction fee rate, satoshis per byte, used to compute required fee (when planning)
int64 byte_fee = 3;
Link copied to clipboard
Change address, as string.
string change_address = 5;
Link copied to clipboard
Coin type (used by forks).
uint32 coin_type = 10;
Link copied to clipboard
Hash type to use when signing.
uint32 hash_type = 1;
Link copied to clipboard
Optional lockTime, default value 0 means no time locking.
If all inputs have final (`0xffffffff`) sequence numbers then `lockTime` is irrelevant.
Otherwise, the transaction may not be added to a block until after `lockTime`.
 value  < 500000000 : Block number at which this transaction is unlocked
 value >= 500000000 : UNIX timestamp at which this transaction is unlocked
uint32 lock_time = 12;
Link copied to clipboard
Optional zero-amount, OP_RETURN output
bytes output_op_return = 13;
Link copied to clipboard
Optional transaction plan. If missing, plan will be computed.
.TW.Bitcoin.Proto.TransactionPlan plan = 11;
Link copied to clipboard
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
Link copied to clipboard
Recipient's address, as string.
string to_address = 4;
Link copied to clipboard
Set if sending max amount is requested.
bool use_max_amount = 9;
Link copied to clipboard
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
open fun getAmount(): Long
Amount to send.  Transaction created will have this amount in its output, 
except when use_max_amount is set, in that case this amount is not relevant, maximum possible amount will be used (max avail less fee).
If amount is equal or more than the available amount, also max amount will be used.
int64 amount = 2;
Link copied to clipboard
open fun getByteFee(): Long
Transaction fee rate, satoshis per byte, used to compute required fee (when planning)
int64 byte_fee = 3;
Link copied to clipboard
Change address, as string.
string change_address = 5;
Link copied to clipboard
open fun getChangeAddressBytes(): ByteString
Change address, as string.
string change_address = 5;
Link copied to clipboard
open fun getCoinType(): Int
Coin type (used by forks).
uint32 coin_type = 10;
Link copied to clipboard
open fun getHashType(): Int
Hash type to use when signing.
uint32 hash_type = 1;
Link copied to clipboard
open fun getLockTime(): Int
Optional lockTime, default value 0 means no time locking.
If all inputs have final (`0xffffffff`) sequence numbers then `lockTime` is irrelevant.
Otherwise, the transaction may not be added to a block until after `lockTime`.
 value  < 500000000 : Block number at which this transaction is unlocked
 value >= 500000000 : UNIX timestamp at which this transaction is unlocked
uint32 lock_time = 12;
Link copied to clipboard
open fun getOutputOpReturn(): ByteString
Optional zero-amount, OP_RETURN output
bytes output_op_return = 13;
Link copied to clipboard
open fun getPlan(): TransactionPlan
Optional transaction plan. If missing, plan will be computed.
.TW.Bitcoin.Proto.TransactionPlan plan = 11;
Link copied to clipboard
open fun getPrivateKey(index: Int): ByteString
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
open fun getPrivateKeyList(): List<ByteString>
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
open fun getScripts(): Map<String, ByteString>
Use getScriptsMap instead.
Link copied to clipboard
open fun getScriptsCount(): Int
Link copied to clipboard
open fun getScriptsMap(): Map<String, ByteString>
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
open fun getScriptsOrDefault(key: String, defaultValue: ByteString): ByteString
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
open fun getScriptsOrThrow(key: String): ByteString
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
open fun getToAddress(): String
Recipient's address, as string.
string to_address = 4;
Link copied to clipboard
open fun getToAddressBytes(): ByteString
Recipient's address, as string.
string to_address = 4;
Link copied to clipboard
Set if sending max amount is requested.
bool use_max_amount = 9;
Link copied to clipboard
open fun getUtxo(index: Int): UnspentTransaction
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
open fun getUtxoCount(): Int
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
open fun getUtxoList(): List<UnspentTransaction>
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
open fun hasPlan(): Boolean
Optional transaction plan. If missing, plan will be computed.
.TW.Bitcoin.Proto.TransactionPlan plan = 11;
Link copied to clipboard
open fun mergePlan(value: TransactionPlan): Bitcoin.SigningInput.Builder
Optional transaction plan. If missing, plan will be computed.
.TW.Bitcoin.Proto.TransactionPlan plan = 11;
Link copied to clipboard
open fun putAllScripts(values: Map<String, ByteString>): Bitcoin.SigningInput.Builder
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
open fun putScripts(key: String, value: ByteString): Bitcoin.SigningInput.Builder
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
Available redeem scripts indexed by script hash.
map<string, bytes> scripts = 7;
Link copied to clipboard
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;
Link copied to clipboard
Amount to send.  Transaction created will have this amount in its output, 
except when use_max_amount is set, in that case this amount is not relevant, maximum possible amount will be used (max avail less fee).
If amount is equal or more than the available amount, also max amount will be used.
int64 amount = 2;
Link copied to clipboard
Transaction fee rate, satoshis per byte, used to compute required fee (when planning)
int64 byte_fee = 3;
Link copied to clipboard
Change address, as string.
string change_address = 5;
Link copied to clipboard
Change address, as string.
string change_address = 5;
Link copied to clipboard
Coin type (used by forks).
uint32 coin_type = 10;
Link copied to clipboard
Hash type to use when signing.
uint32 hash_type = 1;
Link copied to clipboard
Optional lockTime, default value 0 means no time locking.
If all inputs have final (`0xffffffff`) sequence numbers then `lockTime` is irrelevant.
Otherwise, the transaction may not be added to a block until after `lockTime`.
 value  < 500000000 : Block number at which this transaction is unlocked
 value >= 500000000 : UNIX timestamp at which this transaction is unlocked
uint32 lock_time = 12;
Link copied to clipboard
open fun setOutputOpReturn(value: ByteString): Bitcoin.SigningInput.Builder
Optional zero-amount, OP_RETURN output
bytes output_op_return = 13;
Link copied to clipboard
open fun setPlan(builderForValue: Builder): Bitcoin.SigningInput.Builder
open fun setPlan(value: TransactionPlan): Bitcoin.SigningInput.Builder
Optional transaction plan. If missing, plan will be computed.
.TW.Bitcoin.Proto.TransactionPlan plan = 11;
Link copied to clipboard
open fun setPrivateKey(index: Int, value: ByteString): Bitcoin.SigningInput.Builder
The available secret private key or keys required for signing (32 bytes each).
repeated bytes private_key = 6;
Link copied to clipboard
Recipient's address, as string.
string to_address = 4;
Link copied to clipboard
open fun setToAddressBytes(value: ByteString): Bitcoin.SigningInput.Builder
Recipient's address, as string.
string to_address = 4;
Link copied to clipboard
Set if sending max amount is requested.
bool use_max_amount = 9;
Link copied to clipboard
open fun setUtxo(index: Int, builderForValue: Builder): Bitcoin.SigningInput.Builder
open fun setUtxo(index: Int, value: UnspentTransaction): Bitcoin.SigningInput.Builder
Available input unspent transaction outputs.
repeated .TW.Bitcoin.Proto.UnspentTransaction utxo = 8;