new TxEncoder(encryptKey, data, options)
A Transaction encoder object takes an arc obfuscation key and data, and can be used to construct an array of bitcoin output scripts which will store the provided data.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encryptKey |
String | arc4 obfuscation key. Should be obtained from the output transactions first input's prevTxid |
|||||||||||||||||||||
data |
Buffer | ||||||||||||||||||||||
options |
Object |
Properties
|
Members
-
data :Buffer
-
Returns the data being encoded, as was passed in the constructor
Type:
- Buffer
-
disableChangeOutput :Boolean
-
Returns whether this encoding will include an output to return the leftover allocation.
Type:
- Boolean
- Default Value:
-
- true
-
encryptKey :String
-
Returns the arc4 obfuscation key that was passed in the constructor
Type:
- String
-
network :Buffer
-
Returns the Bitcoin network that is being used for senderAddr processing
Type:
- Buffer
- Default Value:
-
- Bitcore.Networks.livenet
-
prefix :String
-
Returns the data prefix of this encoding
Type:
- String
- Default Value:
-
- CNTRPRTY
-
receiverAddr :String
-
Returns the receiverAddr of this encoding.
Type:
- String
- Default Value:
-
- undefined
-
senderAddr :String
-
Returns the senderAddr of this encoding.
Type:
- String
-
senderPubkey :String
-
Returns the senderPubkey that was passed in the constructor (if one was provided)
Type:
- String
Methods
-
toOpMultisig()
-
Return an array of strings representing this data's encoding in the OpMultisig bitcoin output format
Returns:
- Type
- Array
-
toOpReturn()
-
Return an array of strings representing this data's encoding in the OpReturn bitcoin output format
Returns:
- Type
- Array
-
toPubKeyHash()
-
Return an array of strings representing this data's encoding in the PublicKeyHash bitcoin output format
Returns:
- Type
- Array