You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
627 B
24 lines
627 B
7 years ago
|
package com.xsn.explorer.helpers
|
||
|
|
||
|
import com.xsn.explorer.models.rpc.ScriptPubKey
|
||
|
import com.xsn.explorer.models.{Address, TransactionId, TransactionVOUT}
|
||
|
|
||
|
object DataHelper {
|
||
|
|
||
|
def createAddress(string: String) = Address.from(string).get
|
||
|
|
||
|
def createTransactionId(string: String) = TransactionId.from(string).get
|
||
|
|
||
|
def createTransactionVOUT(n: Int, value: BigDecimal, scriptPubKey: ScriptPubKey) = {
|
||
|
TransactionVOUT(
|
||
|
n = n,
|
||
|
value = value,
|
||
|
scriptPubKey = Some(scriptPubKey))
|
||
|
}
|
||
|
|
||
|
def createScriptPubKey(scriptType: String, address: Address) = {
|
||
|
ScriptPubKey(scriptType, "", List(address))
|
||
|
}
|
||
|
|
||
|
}
|