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[T] extends slick.jdbc.JdbcProfile.JdbcAPI.Table[T]
    Definition Classes
    TableAutoIncComponent
  2. case class SpendingInfoTable(tag: slick.jdbc.JdbcProfile.JdbcAPI.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. 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. lazy val database: JdbcDatabaseDef

    The database we are connecting to

    The database we are connecting to

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

    delete all records from the table

    delete all records from the table

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

    Finds all elements in the table

    Finds all elements in the table

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

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

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

    Enumerates all TX outpoints in the wallet

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

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

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

    Finds all utxos for a given account

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

    Enumerates all TX outpoints in the wallet

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

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

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

    Finds all the outputs being spent in the given transaction

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

  63. 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

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

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

  65. def findTxAction(tx: Transaction): slick.jdbc.JdbcProfile.JdbcAPI.DBIOAction[Vector[SpendingInfoDb], slick.jdbc.JdbcProfile.JdbcAPI.NoStream, Read]
  66. def findTxs(txs: Vector[Transaction]): Future[Vector[SpendingInfoDb]]

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

  67. 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

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

    Update the corresponding record in the database

    Update the corresponding record in the database

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

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