This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6334350
commit 14b1d9d
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package fund.cyber.node.model | ||
|
||
import java.math.BigDecimal | ||
import java.math.BigInteger | ||
import java.time.Instant | ||
|
||
/* | ||
* | ||
* Items Previews | ||
* | ||
*/ | ||
|
||
data class BitcoinBlockPreview( | ||
val hash: String, | ||
val height: BigInteger, | ||
val time: Instant, | ||
val merkleroot: String, | ||
val size: Int | ||
) : ItemPreview | ||
|
||
data class BitcoinTransactionPreview( | ||
val hash: String, | ||
val lock_time: Instant, | ||
val block_number: BigInteger, | ||
val fee: BigDecimal | ||
) : ItemPreview | ||
|
||
/* | ||
* | ||
* Bitcoin block | ||
* | ||
*/ | ||
|
||
data class BitcoinBlock( | ||
val hash: String, | ||
val height: BigInteger, | ||
val time: Instant, | ||
val nonce: Int, | ||
val merkleroot: String, | ||
val size: Int, | ||
val version: Int, | ||
val weight: Int, | ||
val bits: Int, | ||
val difficulty: BigInteger, | ||
val txs: List<BitcoinBlockTransaction> | ||
) : Item | ||
|
||
data class BitcoinBlockTransaction( | ||
val fee: BigDecimal, | ||
val lock_time: Instant, | ||
val ins: List<BitcoinBlockTransactionIO>, | ||
val outs: List<BitcoinBlockTransactionIO> | ||
) | ||
|
||
data class BitcoinBlockTransactionIO( | ||
val address: String, | ||
val amount: BigDecimal | ||
) | ||
|
||
/* | ||
* | ||
* Bitcoin transaction | ||
* | ||
*/ | ||
|
||
data class BitcoinTransaction( | ||
val hash: String, | ||
val block_number: BigInteger, | ||
val coinbase: String?, | ||
val lock_time: Instant, | ||
val fee: BigDecimal, | ||
val total_input: BigDecimal, | ||
val total_output: BigDecimal, | ||
val ins: List<BitcoinTransactionIn>, | ||
val outs: List<BitcoinTransactionOut> | ||
) : Item | ||
|
||
data class BitcoinTransactionIn( | ||
val address: String, | ||
val amount: BigDecimal, | ||
val asm: String, | ||
val tx_hash: String, | ||
val tx_out: String | ||
) | ||
|
||
data class BitcoinTransactionOut( | ||
val address: String, | ||
val amount: BigDecimal, | ||
val asm: String, | ||
val out: Short, | ||
val required_signatures: Short | ||
) |