@luxfi/bank 1.3.3 → 1.4.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/dist/index.d.ts +67 -0
- package/dist/index.js +16 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,16 @@ export interface Balance {
|
|
|
50
50
|
kind: 'fiat' | 'crypto';
|
|
51
51
|
valueUsd: number;
|
|
52
52
|
}
|
|
53
|
+
export interface Receiving {
|
|
54
|
+
bankName: string;
|
|
55
|
+
accountHolder: string;
|
|
56
|
+
routingNumber?: string;
|
|
57
|
+
accountNumber?: string;
|
|
58
|
+
accountType?: string;
|
|
59
|
+
iban?: string;
|
|
60
|
+
swift?: string;
|
|
61
|
+
bankAddress?: string;
|
|
62
|
+
}
|
|
53
63
|
export interface Account {
|
|
54
64
|
id: string;
|
|
55
65
|
entityName: string;
|
|
@@ -59,6 +69,7 @@ export interface Account {
|
|
|
59
69
|
status: string;
|
|
60
70
|
kycStatus: string;
|
|
61
71
|
iban: string;
|
|
72
|
+
receiving?: Receiving;
|
|
62
73
|
}
|
|
63
74
|
export interface Wallet {
|
|
64
75
|
id: string;
|
|
@@ -165,6 +176,38 @@ export interface CardholderProfile {
|
|
|
165
176
|
country: string;
|
|
166
177
|
};
|
|
167
178
|
}
|
|
179
|
+
export interface Vault {
|
|
180
|
+
id: string;
|
|
181
|
+
name: string;
|
|
182
|
+
collateral: string;
|
|
183
|
+
underlying: string;
|
|
184
|
+
synthetic: string;
|
|
185
|
+
apy: number;
|
|
186
|
+
maxLtv: number;
|
|
187
|
+
tvlUsd: number;
|
|
188
|
+
description: string;
|
|
189
|
+
}
|
|
190
|
+
export interface Position {
|
|
191
|
+
vault: string;
|
|
192
|
+
collateral: number;
|
|
193
|
+
collateralUsd: number;
|
|
194
|
+
debt: number;
|
|
195
|
+
ltv: number;
|
|
196
|
+
borrowable: number;
|
|
197
|
+
yieldUsdYear: number;
|
|
198
|
+
selfRepayDays: number;
|
|
199
|
+
}
|
|
200
|
+
export type VaultView = Vault & {
|
|
201
|
+
position?: Position | null;
|
|
202
|
+
};
|
|
203
|
+
export interface EarnSummary {
|
|
204
|
+
collateralUsd: number;
|
|
205
|
+
debt: number;
|
|
206
|
+
netUsd: number;
|
|
207
|
+
yieldUsdYear: number;
|
|
208
|
+
positions: number;
|
|
209
|
+
netApy: number;
|
|
210
|
+
}
|
|
168
211
|
export interface Overview {
|
|
169
212
|
sandbox: boolean;
|
|
170
213
|
onboarded: boolean;
|
|
@@ -173,6 +216,7 @@ export interface Overview {
|
|
|
173
216
|
wallet?: Wallet | null;
|
|
174
217
|
wallets?: Wallet[];
|
|
175
218
|
cards?: Card[];
|
|
219
|
+
earn?: EarnSummary;
|
|
176
220
|
recentTransactions?: Transaction[];
|
|
177
221
|
}
|
|
178
222
|
export declare class Bank {
|
|
@@ -260,6 +304,29 @@ export declare class Bank {
|
|
|
260
304
|
sendCrypto(asset: string, amount: number, toAddress: string): Promise<CryptoMove>;
|
|
261
305
|
/** Sandbox-only testnet faucet. */
|
|
262
306
|
depositCrypto(asset: string, amount: number): Promise<CryptoMove>;
|
|
307
|
+
vaults(): Promise<Vault[]>;
|
|
308
|
+
earnVaults(): Promise<VaultView[]>;
|
|
309
|
+
private earnMove;
|
|
310
|
+
earnDeposit(vault: string, amount: number): Promise<{
|
|
311
|
+
vault: string;
|
|
312
|
+
position: Position;
|
|
313
|
+
balances: Balance[];
|
|
314
|
+
}>;
|
|
315
|
+
earnBorrow(vault: string, amount: number): Promise<{
|
|
316
|
+
vault: string;
|
|
317
|
+
position: Position;
|
|
318
|
+
balances: Balance[];
|
|
319
|
+
}>;
|
|
320
|
+
earnRepay(vault: string, amount: number): Promise<{
|
|
321
|
+
vault: string;
|
|
322
|
+
position: Position;
|
|
323
|
+
balances: Balance[];
|
|
324
|
+
}>;
|
|
325
|
+
earnWithdraw(vault: string, amount: number): Promise<{
|
|
326
|
+
vault: string;
|
|
327
|
+
position: Position;
|
|
328
|
+
balances: Balance[];
|
|
329
|
+
}>;
|
|
263
330
|
exchangeQuote(fromCurrency: string, toCurrency: string, amount: number): Promise<ExchangeQuote>;
|
|
264
331
|
exchange(fromCurrency: string, toCurrency: string, amount: number): Promise<ExchangeResult>;
|
|
265
332
|
sandboxLogin(email: string, password: string): Promise<{
|
package/dist/index.js
CHANGED
|
@@ -156,6 +156,22 @@ export class Bank {
|
|
|
156
156
|
depositCrypto(asset, amount) {
|
|
157
157
|
return this.request('POST', '/v1/bank/crypto/deposit', { asset, amount });
|
|
158
158
|
}
|
|
159
|
+
// Earn — Liquid Protocol vaults. `vaults()` is the public catalog; the rest
|
|
160
|
+
// are the caller's positions and movements. deposit/withdraw amounts are in
|
|
161
|
+
// the vault's underlying minor units; borrow/repay are in USD cents.
|
|
162
|
+
vaults() {
|
|
163
|
+
return this.request('GET', '/v1/bank/vaults');
|
|
164
|
+
}
|
|
165
|
+
earnVaults() {
|
|
166
|
+
return this.request('GET', '/v1/bank/earn/vaults');
|
|
167
|
+
}
|
|
168
|
+
earnMove(action, vault, amount) {
|
|
169
|
+
return this.request('POST', `/v1/bank/earn/${action}`, { vault, amount });
|
|
170
|
+
}
|
|
171
|
+
earnDeposit(vault, amount) { return this.earnMove('deposit', vault, amount); }
|
|
172
|
+
earnBorrow(vault, amount) { return this.earnMove('borrow', vault, amount); }
|
|
173
|
+
earnRepay(vault, amount) { return this.earnMove('repay', vault, amount); }
|
|
174
|
+
earnWithdraw(vault, amount) { return this.earnMove('withdraw', vault, amount); }
|
|
159
175
|
// Exchange (fiat FX + crypto buy/sell/convert)
|
|
160
176
|
exchangeQuote(fromCurrency, toCurrency, amount) {
|
|
161
177
|
return this.request('POST', '/v1/bank/exchange/quote', { fromCurrency, toCurrency, amount });
|
package/package.json
CHANGED