c

org.bitcoins.wallet.models

SpendingInfoDAO

case class SpendingInfoDAO()(implicit ec: ExecutionContext, appConfig: WalletAppConfig) extends CRUDAutoInc[UTXORecord] with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SpendingInfoDAO
  2. Serializable
  3. Product
  4. Equals
  5. CRUDAutoInc
  6. TableAutoIncComponent
  7. CRUD
  8. CRUDAction
  9. JdbcProfileComponent
  10. Logging
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new SpendingInfoDAO()(implicit ec: ExecutionContext, appConfig: WalletAppConfig)

Type Members

  1. abstract class TableAutoInc[T] extends slick.jdbc.JdbcProfile.API.Table[T]
    Definition Classes
    TableAutoIncComponent
  2. case class SpendingInfoTable(tag: slick.jdbc.JdbcProfile.API.Tag) extends TableAutoInc[UTXORecord] with Product with Serializable

    This table stores the necessary information to spend a transaction output (TXO) at a later point in time.

    This table stores the necessary information to spend a transaction output (TXO) at a later point in time. It also stores how many confirmations it has, whether or not it is spent (i.e. if it is a UTXO or not) and the TXID of the transaction that created this output.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def _findAllUnspent(): Future[Vector[UTXORecord]]

    Enumerates all unspent TX outputs in the wallet with the state TxoState.PendingConfirmationsReceived or TxoState.ConfirmedReceived

  5. implicit val appConfig: WalletAppConfig
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def count(): Future[Int]

    Returns number of rows in the table

    Returns number of rows in the table

    Definition Classes
    CRUD
  9. def create(si: SpendingInfoDb): Future[SpendingInfoDb]
  10. def create(t: UTXORecord): Future[UTXORecord]

    create a record in the database

    create a record in the database

    t

    - the record to be inserted

    returns

    the inserted record

    Definition Classes
    CRUD
  11. def createAction(t: UTXORecord): slick.jdbc.JdbcProfile.API.DBIOAction[UTXORecord, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  12. def createAll(ts: Vector[UTXORecord]): Future[Vector[UTXORecord]]
    Definition Classes
    CRUDAutoIncCRUD
  13. def createAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAutoIncCRUDAction
  14. def createOutPointsIndexIfNeeded(): Future[Unit]
  15. def createUnless(si: SpendingInfoDb)(condition: (UTXORecord, UTXORecord) => Boolean): Future[SpendingInfoDb]
  16. lazy val database: slick.jdbc.JdbcProfile.API.Database

    The database we are connecting to

    The database we are connecting to

    Definition Classes
    JdbcProfileComponent
  17. lazy val dbConfig: DatabaseConfig[JdbcProfile]

    The configuration details for connecting/using the database for our projects that require database connections

    The configuration details for connecting/using the database for our projects that require database connections

    Definition Classes
    JdbcProfileComponent
  18. lazy val dbPassword: String
    Definition Classes
    JdbcProfileComponent
  19. lazy val dbUsername: String
    Definition Classes
    JdbcProfileComponent
  20. def debug(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. def debug(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  22. def debug(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  23. def delete(si: SpendingInfoDb): Future[Int]
  24. def delete(t: UTXORecord): Future[Int]

    delete the corresponding record in the database

    delete the corresponding record in the database

    t

    - the record to be deleted

    returns

    int - the number of rows affected by the deletion

    Definition Classes
    CRUD
  25. def deleteAction(si: SpendingInfoDb): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write]
  26. def deleteAction(t: UTXORecord): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  27. def deleteAll(): Future[Int]

    delete all records from the table

    delete all records from the table

    Definition Classes
    CRUD
  28. def deleteAll(ts: Vector[UTXORecord]): Future[Int]
    Definition Classes
    CRUD
  29. def deleteAllAction(): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write with Transactional]

    WARNING: Deletes all rows in table, use with care

    WARNING: Deletes all rows in table, use with care

    Definition Classes
    CRUDAction
  30. def deleteAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  31. def deleteSpendingInfoDbAllAction(sis: Vector[SpendingInfoDb]): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write]
  32. implicit val ec: ExecutionContext
    Definition Classes
    SpendingInfoDAOCRUDCRUDAction
  33. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. def error(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def error(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def error(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  38. def find(t: UTXORecord): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], UTXORecord, Seq]
    Attributes
    protected
    Definition Classes
    CRUDAction
  39. def findAll(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], UTXORecord, Seq]
    Definition Classes
    CRUDAutoIncCRUDAction
  40. def findAll(): Future[Vector[UTXORecord]]

    Finds all elements in the table

    Finds all elements in the table

    Definition Classes
    CRUD
  41. def findAllAction(): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  42. def findAllForAccount(hdAccount: HDAccount): Future[Vector[SpendingInfoDb]]
  43. def findAllForAccountAction(hdAccount: HDAccount): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.API.NoStream, Read]
  44. def findAllInMempool: Future[Vector[SpendingInfoDb]]

    Enumerates all TX outputs in the wallet with the state TxoState.BroadcastSpent or TxoState.BroadcastReceived

  45. def findAllOutpoints(): Future[Vector[TransactionOutPoint]]

    Enumerates all TX outpoints in the wallet

  46. def findAllPendingConfirmation: Future[Vector[SpendingInfoDb]]

    Enumerates all TX outputs in the wallet with the state TxoState.PendingConfirmationsReceived or TxoState.PendingConfirmationsSpent

  47. def findAllSpendingInfos(): Future[Vector[SpendingInfoDb]]
  48. def findAllSpendingInfosAction(): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.API.NoStream, Read]
  49. def findAllUnspent(): Future[Vector[SpendingInfoDb]]
  50. def findAllUnspentForAccount(hdAccount: HDAccount): Future[Vector[SpendingInfoDb]]

    Finds all utxos for a given account

  51. def findAllUnspentForTag(tag: AddressTag): Future[Vector[SpendingInfoDb]]
  52. def findByOutPoint(outPoint: TransactionOutPoint): Future[Option[SpendingInfoDb]]
  53. def findByOutPoints(outPoints: Vector[TransactionOutPoint]): Future[Vector[SpendingInfoDb]]

    Enumerates all TX outpoints in the wallet

  54. def findByPrimaryKey(id: Long): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], UTXORecord, Seq]

    return all rows that have a certain primary key

    return all rows that have a certain primary key

    returns

    Query object corresponding to the selected rows

    Attributes
    protected
    Definition Classes
    CRUDAction
  55. def findByPrimaryKeyAction(id: Long): slick.jdbc.JdbcProfile.API.DBIOAction[Option[UTXORecord], slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  56. def findByPrimaryKeys(ids: Vector[Long]): slick.jdbc.JdbcProfile.API.Query[TableAutoInc[UTXORecord], UTXORecord, Seq]

    Finds the rows that correlate to the given primary keys

    Finds the rows that correlate to the given primary keys

    Definition Classes
    CRUDAutoIncCRUDAction
  57. def findByPrimaryKeysAction(ids: Vector[Long]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  58. def findByScriptPubKey(scriptPubKey: ScriptPubKey): Future[Vector[SpendingInfoDb]]
  59. def findByScriptPubKeyId(scriptPubKeyId: Long): Future[Vector[UTXORecord]]
  60. def findByTxoState(state: TxoState): Future[Vector[SpendingInfoDb]]
  61. def findDbsForTx(txid: DoubleSha256DigestBE): Future[Vector[UTXORecord]]

    Fetches all the incoming TXOs in our DB that are in the transaction with the given TXID

  62. def findOutputsBeingSpent(txs: Vector[Transaction]): Future[Vector[SpendingInfoDb]]
  63. def findOutputsBeingSpent(tx: Transaction): Future[Vector[SpendingInfoDb]]

    Finds all the outputs being spent in the given transaction

  64. def findOutputsReceived(txids: Vector[DoubleSha256DigestBE]): Future[Vector[SpendingInfoDb]]

    Fetches all the incoming TXOs in our DB that are in the transaction with the given TXID

  65. def findTx(tx: Transaction): Future[Vector[SpendingInfoDb]]

    Fetches all the received TXOs in our DB that are in the given TX

  66. def findTxs(txs: Vector[Transaction]): Future[Vector[SpendingInfoDb]]

    Fetches all received txos in our db that are in the given txs

  67. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  68. def hasDuplicates(): Future[Boolean]
  69. def info(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  70. def info(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  71. def info(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  72. def infoToUtxo(infos: Vector[SpendingInfoDb]): Future[Vector[UTXORecord]]
  73. def isDebugEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  74. def isErrorEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  75. def isInfoEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  76. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  77. def isTraceEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  78. def isWarnEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  79. def logger: Logger
    Attributes
    protected
    Definition Classes
    Logging
  80. def loggerName: String
    Attributes
    protected
    Definition Classes
    Logging
  81. def markAsReserved(ts: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
  82. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  83. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  84. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  85. lazy val numThreads: Int
    Definition Classes
    JdbcProfileComponent
  86. def productElementNames: Iterator[String]
    Definition Classes
    Product
  87. lazy val profile: JdbcProfile
    Definition Classes
    JdbcProfileComponent
  88. def read(id: Long): Future[Option[UTXORecord]]

    read a record from the database

    read a record from the database

    id

    - the id of the record to be read

    returns

    Option[T] - the record if found, else none

    Definition Classes
    CRUD
  89. def safeDatabase: SafeDatabase

    Binding to the actual database itself, this is what is used to run querys

    Binding to the actual database itself, this is what is used to run querys

    Definition Classes
    CRUD
  90. val schemaName: Option[String]
    Definition Classes
    CRUD
  91. def startHikariLogger(interval: Duration): HikariLogging

    Starts the background logger for hikari

    Starts the background logger for hikari

    interval

    - how often hikari logs database connection pool information

    Attributes
    protected
    Definition Classes
    JdbcProfileComponent
  92. def stopHikariLogger(): Unit
    Attributes
    protected
    Definition Classes
    JdbcProfileComponent
  93. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  94. val table: slick.jdbc.JdbcProfile.API.TableQuery[SpendingInfoTable]

    The table inside our database we are inserting into

    The table inside our database we are inserting into

    Definition Classes
    SpendingInfoDAOCRUDAutoIncCRUDAction
  95. implicit def tableQuerySafeSubtypeCast[SpecificT <: AbstractTable[_], SomeT <: SpecificT](tableQuery: slick.jdbc.JdbcProfile.API.TableQuery[SomeT]): slick.jdbc.JdbcProfile.API.TableQuery[SpecificT]

    We need to cast from TableQuery's of internal types (e.g.

    We need to cast from TableQuery's of internal types (e.g. AddressDAO#AddressTable) to external versions of them (e.g. AddressDAO().table). You'll notice that although the latter is a subtype of the first, this requires a cast since TableQuery is not covariant in its type parameter.

    However, since Query is covariant in its first type parameter, I believe the cast from TableQuery[T1] to TableQuery[T2] will always be safe so long as T1 is a subtype of T2 AND T1#TableElementType is equal to T2#TableElementType.

    The above conditions are always the case when this is called within DAOs as it is only ever used for things of the form TableQuery[XDAO().table] -> TableQuery[XDAO#XTable].

    Attributes
    protected
    Definition Classes
    CRUD
  96. def trace(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  97. def trace(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  98. def trace(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  99. def update(si: SpendingInfoDb): Future[SpendingInfoDb]
  100. def update(t: UTXORecord): Future[UTXORecord]

    Update the corresponding record in the database

    Update the corresponding record in the database

    Definition Classes
    CRUD
  101. def updateAction(t: UTXORecord): slick.jdbc.JdbcProfile.API.DBIOAction[UTXORecord, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  102. def updateAll(ts: Vector[UTXORecord]): Future[Vector[UTXORecord]]
    Definition Classes
    CRUD
  103. def updateAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.API.NoStream, Write]

    Updates all of the given ts.

    Updates all of the given ts. Returns all ts that actually existed in the database and got updated This method discards things that did not exist in the database, thus could not be updated

    Definition Classes
    CRUDAction
  104. def updateAllSpendingInfoDb(ts: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
  105. def upsert(si: SpendingInfoDb): Future[SpendingInfoDb]
  106. def upsert(t: UTXORecord): Future[UTXORecord]

    insert the record if it does not exist, update it if it does

    insert the record if it does not exist, update it if it does

    t

    - the record to inserted / updated

    returns

    t - the record that has been inserted / updated

    Definition Classes
    CRUD
  107. def upsertAction(t: UTXORecord): slick.jdbc.JdbcProfile.API.DBIOAction[UTXORecord, slick.jdbc.JdbcProfile.API.NoStream, Write with Read]
    Definition Classes
    CRUDAction
  108. def upsertAll(ts: Vector[UTXORecord]): Future[Vector[UTXORecord]]

    Upserts all of the given ts in the database, then returns the upserted values

    Upserts all of the given ts in the database, then returns the upserted values

    Definition Classes
    CRUD
  109. def upsertAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.API.NoStream, Write with Read]

    Upsert all of the given ts.

    Upsert all of the given ts. Returns all ts that were inserted or updated

    Definition Classes
    CRUDAction
    See also

    https://scala-slick.org/doc/3.3.3/queries.html#upserting

  110. def upsertAllSpendingInfoDb(ts: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
  111. def utxoToInfo(utxos: Vector[UTXORecord]): Future[Vector[SpendingInfoDb]]
  112. def utxoToInfoAction(utxos: Vector[UTXORecord]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.API.NoStream, Read]
  113. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  114. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  115. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  116. def warn(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  117. def warn(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  118. def warn(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  119. def withAddress(txid: DoubleSha256DigestBE): Future[Vector[(SpendingInfoDb, AddressDb)]]

    Given a TXID, fetches all incoming TXOs and the address the TXO pays to

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from CRUDAutoInc[UTXORecord]

Inherited from CRUD[UTXORecord, Long]

Inherited from CRUDAction[UTXORecord, Long]

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped