@kasufinance/kasu-sdk 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/dist/bundle.cjs.js +674 -59
- package/dist/bundle.esm.js +673 -60
- package/dist/domain/index.d.ts +4 -2
- package/dist/domain/index.js +1 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/yield-history.d.ts +122 -0
- package/dist/domain/yield-history.js +95 -0
- package/dist/domain/yield-history.js.map +1 -0
- package/dist/facade/user-portfolio.d.ts +32 -0
- package/dist/facade/user-portfolio.js +34 -0
- package/dist/facade/user-portfolio.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/services/Portfolio/portfolio.d.ts +37 -0
- package/dist/services/Portfolio/portfolio.js +136 -56
- package/dist/services/Portfolio/portfolio.js.map +1 -1
- package/dist/services/Portfolio/queries.js +15 -3
- package/dist/services/Portfolio/queries.js.map +1 -1
- package/dist/services/Portfolio/types.d.ts +8 -0
- package/dist/services/Portfolio/yield-history.d.ts +177 -0
- package/dist/services/Portfolio/yield-history.js +405 -0
- package/dist/services/Portfolio/yield-history.js.map +1 -0
- package/package.json +1 -1
- package/src/domain/index.ts +12 -10
- package/src/domain/yield-history.ts +194 -0
- package/src/facade/user-portfolio.ts +40 -3
- package/src/index.ts +2 -0
- package/src/services/Portfolio/portfolio.ts +263 -153
- package/src/services/Portfolio/queries.ts +15 -3
- package/src/services/Portfolio/types.ts +10 -0
- package/src/services/Portfolio/yield-history.ts +574 -0
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ You can also pass a whole `ChainConfigEntry` instead of a chain key.
|
|
|
118
118
|
| ----------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
119
119
|
| `kasu.strategies` | `getAll()`, `getVisible()`, `getById()`, `getPlatformStats()`, `getPerformanceFeePercent()`, `calculateDepositLimits()`, `getRiskPerformance(poolId)`, `getOriginator(poolId)` | Browse pools, APY, capacity, risk, originator |
|
|
120
120
|
| `kasu.deposits` | `deposit()`, `withdraw()`, `withdrawMax()`, `buildKycParams()`, `isClearingPending()` | Submit transactions |
|
|
121
|
-
| `kasu.portfolio` | `getPositions()`, `getTransactionHistory()`, `getRequestStates()`
|
|
121
|
+
| `kasu.portfolio` | `getPositions()`, `getYieldHistory()`, `getTransactionHistory()`, `getRequestStates()` | Lender balances, yield, per-cycle earnings (net, in the chain's own stable token), history |
|
|
122
122
|
| `kasu.flows` | `deposit(ports)`, `withdraw(ports?)` | Headless transaction pipelines |
|
|
123
123
|
| `kasu.calls` | `requestWithdrawal(params)`, `cancelDepositRequest(poolId, dNftId)`, `cancelWithdrawalRequest(poolId, wNftId)`, `withdrawAtExpiry(poolId, lockId)` | Encoded calls for a sponsored relay (read, then encode — never sends) |
|
|
124
124
|
|
|
@@ -132,6 +132,16 @@ return an empty list; pass it straight through. `SdkConfig` normalises an empty
|
|
|
132
132
|
exclusion list to `['']`, because the subgraph reads `id_not_in: []` as "match
|
|
133
133
|
nothing" and would otherwise hide every pool.
|
|
134
134
|
|
|
135
|
+
`kasu.portfolio.getYieldHistory(user, { fromEpoch?, count? })` returns one
|
|
136
|
+
`{ epochId, epochEnd, poolId, trancheId, netYield }` per settled cycle the
|
|
137
|
+
lender held shares in; `aggregateYieldHistory(entries, { poolId? })` turns it
|
|
138
|
+
into chart bars. `netYield` is NET of the performance fee and in the
|
|
139
|
+
deployment's own stable token (AUDD on XDC AUDD — convert before showing USD);
|
|
140
|
+
`epochEnd` is unix seconds. For a fixed-term lock holder the bars can sum to
|
|
141
|
+
slightly more than lifetime interest (up to about 0.2 %, top-ups are valued at
|
|
142
|
+
today's share price), so show "earned to date" from the lifetime figure, not
|
|
143
|
+
from the sum of the bars.
|
|
144
|
+
|
|
135
145
|
## Domain helpers
|
|
136
146
|
|
|
137
147
|
Pure functions shared by every Kasu frontend. They return **numbers and codes,
|