This repository has been archived by the owner on May 7, 2024. It is now read-only.
forked from centrifuge/api
-
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.
20221012 Integrate progress until sprint 13 (#20)
* 74 index loanentity data types (#86) * feat: create loanService * refactor: improved service getters * feat: increase outstandingDebt on borrowings * feat: basics for handle loan prices * feat: save priced loans * feat: activate loan when priced * feat: handle writeoffs * feat: handle loan closed and write offs * fix: loan.repay() should increase totalRepaid * fix: invest execution decimals and avoid empty transactions (#87) * 82 add prices to all investortransaction types (#88) * chore: update chain data * feat: extend InvestorTransaction decoration and refactor * feat: use rpc prices from trancheTokenPrices() when investor transactions are processed (#89) * feat: improved loans and borrower transactions (#90) * 63 convert outflows to dai (#91) * feat: add currency value for redeem fields * fix: currency conversion should support null prices * 98 failing poolservicegettranchetokenprices causes period to be skipped for remaining pools (#99) * ci: fix deployment version * fix: handle missing price updates from RPC * fix: throw errors on missing prices * feat: aggregate total investments and repayments for epoches (#100) * feat: index accounts and tranche balances (#101) * docs: add deployment status badge * Update README.md docs: fix badge link to deployment workflow * feat: tracking loans history with state snapshot (#102) * 56 handle updates to pool information poolsupdated event (#106) * chore: upgraded packages * feat: track pool updates * 103 totalinvested and totalredeemed are missing in poolsnapshot (#107) * fix: add missing properties to snapshot * deploy: update node and query versions * fix: pool investment and redemptions totals * feat: indexing missing values (#108) * ci: updated deployment * ci: upgraded packages * feat: paginated getters for snapshots and models (#109) * chore: upgrade packages * 104 track currency balances for accounts (#111) * feat: add data model for currency balances * feat: track endowments withdrawals and deposits of currency * feat: get initial balance on currency balance init * ci: revert subql/node version Co-authored-by: Timon <timon@embrio.tech>
- Loading branch information
Showing
25 changed files
with
2,799 additions
and
1,414 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
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,5 @@ | ||
#!/bin/sh | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<EOF | ||
CREATE EXTENSION IF NOT EXISTS btree_gist; | ||
EOF |
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,9 @@ | ||
FROM postgres:12-alpine | ||
|
||
# Variables needed at runtime to configure postgres and run the initdb scripts | ||
ENV POSTGRES_DB 'postgres' | ||
ENV POSTGRES_USER 'postgres' | ||
ENV POSTGRES_PASSWORD 'postgres' | ||
|
||
# Copy in the load-extensions script | ||
COPY docker/load-extensions.sh /docker-entrypoint-initdb.d/ |
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
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,21 @@ | ||
import { errorHandler } from './errorHandler' | ||
|
||
type StoreArgs = Parameters<typeof store.getByField> | ||
type StoreReturn = ReturnType<typeof store.getByField> | ||
|
||
interface Entity { | ||
id: string | ||
} | ||
|
||
async function _paginatedGetter(entity: StoreArgs[0], field: StoreArgs[1], value: StoreArgs[2]): StoreReturn { | ||
let results: Entity[] = [] | ||
const batch = 100 | ||
let amount = 0 | ||
do { | ||
const entities = await store.getByField(entity, field, value, { offset: amount, limit: batch }) | ||
results = results.concat(entities) | ||
amount += results.length | ||
} while (results.length === batch) | ||
return results | ||
} | ||
export const paginatedGetter = errorHandler(_paginatedGetter) |
Oops, something went wrong.