-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1187 from cardano-foundation/feat/MET-2064-apply-…
…script-controller-with-ledger-sync-v2 feat: apply Script Controller with ledger sync v2
- Loading branch information
Showing
10 changed files
with
534 additions
and
487 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
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
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
28 changes: 28 additions & 0 deletions
28
...rg/cardanofoundation/explorer/api/repository/ledgersync/LatestTokenBalanceRepository.java
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,28 @@ | ||
package org.cardanofoundation.explorer.api.repository.ledgersync; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import org.cardanofoundation.explorer.api.projection.AddressTokenProjection; | ||
import org.cardanofoundation.explorer.common.entity.compositeKey.AddressBalanceId; | ||
import org.cardanofoundation.explorer.common.entity.ledgersync.LatestTokenBalance; | ||
|
||
public interface LatestTokenBalanceRepository extends | ||
JpaRepository<LatestTokenBalance, AddressBalanceId> { | ||
|
||
@Query( | ||
value = """ | ||
SELECT ltb.address as address, ltb.quantity as quantity, ma.nameView as tokenName, ma.fingerprint as fingerprint | ||
FROM LatestTokenBalance ltb | ||
inner JOIN MultiAsset ma ON ma.unit = ltb.unit | ||
WHERE ma.policy = :policy | ||
order by ltb.quantity desc | ||
""") | ||
List<AddressTokenProjection> findAddressAndBalanceByPolicy( | ||
@Param("policy") String policy, Pageable pageable); | ||
} |
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
Oops, something went wrong.