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. BitcoinSLogger
  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 extends slick.jdbc.JdbcProfile.JdbcAPI.Table[T]
    Definition Classes
    TableAutoIncComponent
  2. case class SpendingInfoTable(tag: slick.jdbc.JdbcProfile.JdbcAPI.Tag) extends TableAutoInc 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. def _findAllUnspentAction(): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]

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

  6. def _findByStateAction(states: Vector[TxoState]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  7. implicit val appConfig: WalletAppConfig
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def count(): Future[Int]

    Returns number of rows in the table

    Returns number of rows in the table

    Definition Classes
    CRUD
  11. def countAction: slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Int, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
    Definition Classes
    CRUDAction
  12. def create(si: SpendingInfoDb): Future[SpendingInfoDb]
  13. 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
  14. def createAction(t: UTXORecord): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[UTXORecord, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
    Definition Classes
    CRUDAction
  15. def createAll(ts: Vector[UTXORecord]): Future[Vector[UTXORecord]]
    Definition Classes
    CRUDAutoIncCRUD
  16. def createAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
    Definition Classes
    CRUDAutoIncCRUDAction
  17. def createUnless(si: SpendingInfoDb)(condition: (UTXORecord, UTXORecord) => Boolean): Future[SpendingInfoDb]
  18. def createUnlessAction(si: SpendingInfoDb)(condition: (UTXORecord, UTXORecord) => Boolean): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[SpendingInfoDb, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write with Read]
  19. lazy val database: JdbcDatabaseDef

    The database we are connecting to

    The database we are connecting to

    Definition Classes
    JdbcProfileComponent
  20. 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
  21. def delete(si: SpendingInfoDb): Future[Int]
  22. 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
  23. def deleteAction(si: SpendingInfoDb): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Int, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
  24. def deleteAction(t: UTXORecord): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Int, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
    Definition Classes
    CRUDAction
  25. def deleteAll(): Future[Int]

    delete all records from the table

    delete all records from the table

    Definition Classes
    CRUD
  26. def deleteAll(ts: Vector[UTXORecord]): Future[Int]
    Definition Classes
    CRUD
  27. def deleteAllAction(): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Int, slick.jdbc.JdbcProfile.JdbcAPI.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
  28. def deleteAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Int, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
    Definition Classes
    CRUDAction
  29. def deleteSpendingInfoDbAllAction(sis: Vector[SpendingInfoDb]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Int, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
  30. implicit val ec: ExecutionContext
    Definition Classes
    SpendingInfoDAOCRUDCRUDAction
  31. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  33. def find(t: UTXORecord): slick.jdbc.JdbcProfile.JdbcAPI.Query[slick.jdbc.JdbcProfile.JdbcAPI.Table[UTXORecord], UTXORecord, Seq]
    Attributes
    protected
    Definition Classes
    CRUDAction
  34. def findAll(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.JdbcAPI.Query[slick.jdbc.JdbcProfile.JdbcAPI.Table[UTXORecord], UTXORecord, Seq]
    Definition Classes
    CRUDAutoIncCRUDAction
  35. def findAll(): Future[Vector[UTXORecord]]

    Finds all elements in the table

    Finds all elements in the table

    Definition Classes
    CRUD
  36. def findAllAction(): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
    Definition Classes
    CRUDAction
  37. def findAllForAccount(hdAccount: HDAccount): Future[Vector[SpendingInfoDb]]
  38. def findAllForAccountAction(hdAccount: HDAccount): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  39. def findAllInMempool: Future[Vector[SpendingInfoDb]]

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

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

    Enumerates all TX outpoints in the wallet

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

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

  42. def findAllSpendingInfos(): Future[Vector[SpendingInfoDb]]
  43. def findAllSpendingInfosAction(): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  44. def findAllUnspent(): Future[Vector[SpendingInfoDb]]
  45. def findAllUnspentAction(): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  46. def findAllUnspentForAccount(hdAccount: HDAccount): Future[Vector[SpendingInfoDb]]

    Finds all utxos for a given account

  47. def findAllUnspentForAccountAction(hdAccount: HDAccount): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  48. def findAllUnspentForTag(tag: AddressTag): Future[Vector[SpendingInfoDb]]
  49. def findAllUnspentForTagAction(tag: AddressTag): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  50. def findByOutPoint(outPoint: TransactionOutPoint): Future[Option[SpendingInfoDb]]
  51. def findByOutPoints(outPoints: Vector[TransactionOutPoint]): Future[Vector[SpendingInfoDb]]

    Enumerates all TX outpoints in the wallet

  52. def findByPrimaryKey(id: Long): slick.jdbc.JdbcProfile.JdbcAPI.Query[TableAutoInc, UTXORecord, Seq]

    return all rows that have a certain primary key

    return all rows that have a certain primary key

    id

    primary key of the row to return

    returns

    Query object corresponding to the selected rows

    Attributes
    protected
    Definition Classes
    CRUDAutoIncCRUDAction
  53. def findByPrimaryKeyAction(id: Long): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Option[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
    Definition Classes
    CRUDAction
  54. def findByPrimaryKeys(ids: Vector[Long]): slick.jdbc.JdbcProfile.JdbcAPI.Query[TableAutoInc, 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
  55. def findByPrimaryKeysAction(ids: Vector[Long]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
    Definition Classes
    CRUDAction
  56. def findByScriptPubKey(scriptPubKey: ScriptPubKey): Future[Vector[SpendingInfoDb]]
  57. def findByScriptPubKeyId(scriptPubKeyId: Long): Future[Vector[UTXORecord]]
  58. def findByTxoState(state: TxoState): Future[Vector[SpendingInfoDb]]
  59. def findDbsForTx(txid: DoubleSha256DigestBE): Future[Vector[UTXORecord]]

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

  60. def findOutputsBeingSpent(txs: Vector[Transaction]): Future[Vector[SpendingInfoDb]]
  61. def findOutputsBeingSpent(tx: Transaction): Future[Vector[SpendingInfoDb]]

    Finds all the outputs being spent in the given transaction

  62. def findOutputsBeingSpentAction(txs: Vector[Transaction]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  63. 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

  64. def findOutputsReceivedAction(txids: Vector[DoubleSha256DigestBE]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]

    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 findTxAction(tx: Transaction): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  67. def findTxs(txs: Vector[Transaction]): Future[Vector[SpendingInfoDb]]

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

  68. def findTxsAction(txs: Vector[Transaction]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]

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

  69. def getBalanceAction(accountOpt: Option[HDAccount] = None): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[CurrencyUnit, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  70. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  71. def getConfirmedBalanceAction(accountOpt: Option[HDAccount] = None): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[CurrencyUnit, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  72. def getUnconfirmedBalanceAction(accountOpt: Option[HDAccount] = None): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[CurrencyUnit, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  73. def hasDuplicates(): Future[Boolean]
  74. def infoToUtxo(infos: Vector[SpendingInfoDb]): Future[Vector[UTXORecord]]
  75. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  76. def logger: Logger
    Definition Classes
    BitcoinSLogger
  77. def markAsReserved(ts: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
  78. def markAsReservedAction(ts: Vector[SpendingInfoDb]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read with Write]
  79. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  80. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  81. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  82. lazy val numThreads: Int
    Definition Classes
    JdbcProfileComponent
  83. def productElementNames: Iterator[String]
    Definition Classes
    Product
  84. lazy val profile: JdbcProfile
    Definition Classes
    JdbcProfileComponent
  85. 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
  86. 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
  87. val schemaName: Option[String]
    Definition Classes
    CRUD
  88. 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
  89. def stopHikariLogger(): Unit
    Attributes
    protected
    Definition Classes
    JdbcProfileComponent
  90. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  91. val table: slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[SpendingInfoTable]

    The table inside our database we are inserting into

    The table inside our database we are inserting into

    Definition Classes
    SpendingInfoDAOCRUDAutoIncCRUDAction
  92. implicit def tableQuerySafeSubtypeCast[SpecificT <: AbstractTable[_], SomeT <: SpecificT](tableQuery: slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[SomeT]): slick.jdbc.JdbcProfile.JdbcAPI.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
  93. def update(si: SpendingInfoDb): Future[SpendingInfoDb]
  94. def update(t: UTXORecord): Future[UTXORecord]

    Update the corresponding record in the database

    Update the corresponding record in the database

    Definition Classes
    CRUD
  95. def updateAction(si: SpendingInfoDb): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[SpendingInfoDb, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read with Write]
  96. def updateAction(t: UTXORecord): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[UTXORecord, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write]
    Definition Classes
    CRUDAction
  97. def updateAll(ts: Vector[UTXORecord]): Future[Vector[UTXORecord]]
    Definition Classes
    CRUD
  98. def updateAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.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
  99. def updateAllSpendingInfoDb(ts: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
  100. def updateAllSpendingInfoDbAction(ts: Vector[SpendingInfoDb]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read with Write]
  101. def upsert(si: SpendingInfoDb): Future[SpendingInfoDb]
  102. 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
  103. def upsertAction(si: SpendingInfoDb): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[SpendingInfoDb, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read with Write]
  104. def upsertAction(t: UTXORecord): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[UTXORecord, slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Write with Read]
    Definition Classes
    CRUDAction
  105. 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
  106. def upsertAllAction(ts: Vector[UTXORecord]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[UTXORecord], slick.jdbc.JdbcProfile.JdbcAPI.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

  107. def upsertAllSpendingInfoDb(ts: Vector[SpendingInfoDb]): Future[Vector[SpendingInfoDb]]
  108. def upsertAllSpendingInfoDbAction(ts: Vector[SpendingInfoDb]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read with Write]
  109. def utxoToInfo(utxos: Vector[UTXORecord]): Future[Vector[SpendingInfoDb]]
  110. def utxoToInfoAction(utxos: Vector[UTXORecord]): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  111. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  112. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  113. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  114. 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 BitcoinSLogger

Inherited from AnyRef

Inherited from Any

Ungrouped