mirror of
https://github.com/luxfi/bank.git
synced 2026-10-30 17:02:07 +00:00
The bank, the crypto wallet, and DeFi are now one app. Earn is the Liquid
Protocol self-repaying-loan layer: deposit yield-bearing collateral into a
vault, borrow the vault's synthetic x-token against it up to the vault's LTV,
and the collateral yield repays the debt.
Backend (liquid.go, collections/vaults.go):
- Vault catalog (stLUX/xLUX, wstETH/xETH, USDC/xUSD, sDAI/xUSD) as curated data,
like the plan ladder; positions are per-account per-vault user data.
- One handler (earnAction) behind all four verbs. Deposit/withdraw move the
vault's underlying asset; borrow/repay move USD. Money flows through the same
transaction ledger (a settled `earn`-type tx — no wire fee, no forex routing —
so it validates debits against live balances and shows in Activity). Borrow is
gated by the LTV ceiling; withdraw by the collateralization floor.
- Public GET /v1/bank/vaults (catalog); authed GET /v1/bank/earn/vaults (catalog
+ positions) and POST /v1/bank/earn/{deposit,borrow,repay,withdraw}; overview
carries an earn summary. Seeded with two demo positions.
- Fix a money-losing bug: position collateral/debt were Required NumberFields,
and Base treats 0 as blank — so a first deposit into an empty vault settled
the debit then 500'd on the position save. Dropped Required.
Dash: an Earn destination (sidebar + mobile tab) — summary hero, your positions
with LTV health + honest self-repay horizons (years, not days), other vaults,
and a per-vault deposit/borrow/repay/withdraw panel that shows headroom and
blocks over-limit moves. A dashboard Earn card links in when a position is open;
earn movements flow into Activity. Also fixed a pre-existing Modal bug — the
shell's stacking context trapped its z-index under the mobile tab bar, making
modal buttons untappable at 390px; Modal now portals to document.body.
SDK 1.4.0: Vault/Position/VaultView/EarnSummary + earn methods. 34/34 e2e green
(new earn.spec). Backend go test/vet/staticcheck/deadcode clean.
Co-authored-by: Hanzo Dev <[email protected]>
33 lines
726 B
JSON
33 lines
726 B
JSON
{
|
|
"name": "@luxfi/bank",
|
|
"version": "1.4.0",
|
|
"description": "Typed client for the Lux banking API (/v1/bank) \u2014 accounts, payments, cards, crypto, FX, and membership plans.",
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/luxfi/bank.git",
|
|
"directory": "sdk"
|
|
},
|
|
"type": "module",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
}
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"README.md"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"prepublishOnly": "tsc",
|
|
"test": "node --test test/bank.test.ts"
|
|
},
|
|
"devDependencies": {
|
|
"typescript": "^5.9.0"
|
|
}
|
|
}
|